111
This commit is contained in:
@@ -55,12 +55,14 @@ class OnWorkerStart implements EventDispatcherInterface
|
|||||||
/**
|
/**
|
||||||
* @param $event
|
* @param $event
|
||||||
* @throws \Kiri\Exception\ConfigException
|
* @throws \Kiri\Exception\ConfigException
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function onTaskInit($event)
|
public function onTaskInit($event)
|
||||||
{
|
{
|
||||||
$this->annotation->read(APP_PATH . 'app', 'App', [CONTROLLER_PATH]);
|
|
||||||
|
|
||||||
putenv('environmental=' . Kiri::TASK);
|
putenv('environmental=' . Kiri::TASK);
|
||||||
|
if (is_enable_file_modification_listening()) {
|
||||||
|
$this->annotation->read(APP_PATH . 'app', 'App', [CONTROLLER_PATH]);
|
||||||
|
}
|
||||||
|
|
||||||
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Tasker[%d].%d start.", $event->server->worker_pid, $event->workerId) . PHP_EOL;
|
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Tasker[%d].%d start.", $event->server->worker_pid, $event->workerId) . PHP_EOL;
|
||||||
|
|
||||||
@@ -75,14 +77,17 @@ class OnWorkerStart implements EventDispatcherInterface
|
|||||||
*/
|
*/
|
||||||
public function onWorkerInit($event)
|
public function onWorkerInit($event)
|
||||||
{
|
{
|
||||||
$this->annotation->read(APP_PATH . 'app');
|
|
||||||
putenv('environmental=' . Kiri::WORKER);
|
putenv('environmental=' . Kiri::WORKER);
|
||||||
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Worker[%d].%d start.", $event->server->worker_pid, $event->workerId) . PHP_EOL;
|
|
||||||
$this->setProcessName(sprintf('Worker[%d].%d', $event->server->worker_pid, $event->workerId));
|
|
||||||
if (is_enable_file_modification_listening()) {
|
if (is_enable_file_modification_listening()) {
|
||||||
|
$this->annotation->read(APP_PATH . 'app');
|
||||||
$loader = Kiri::app()->getRouter();
|
$loader = Kiri::app()->getRouter();
|
||||||
$loader->_loader();
|
$loader->_loader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Worker[%d].%d start.", $event->server->worker_pid, $event->workerId) . PHP_EOL;
|
||||||
|
|
||||||
|
$this->setProcessName(sprintf('Worker[%d].%d', $event->server->worker_pid, $event->workerId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ use Annotation\Attribute;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $class
|
* @param static $params
|
||||||
|
* @param mixed $class
|
||||||
* @param mixed|null $method
|
* @param mixed|null $method
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ use Http\IInterface\MiddlewareInterface;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param static $params
|
||||||
* @param mixed $class
|
* @param mixed $class
|
||||||
* @param mixed|null $method
|
* @param mixed|null $method
|
||||||
* @return $this
|
* @return $this
|
||||||
|
|||||||
@@ -24,10 +24,12 @@ use Kiri\Kiri;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param static $params
|
||||||
* @param mixed $class
|
* @param mixed $class
|
||||||
* @param mixed|null $method
|
* @param mixed|null $method
|
||||||
* @return Router
|
* @return Router
|
||||||
* @throws Exception
|
* @throws \Kiri\Exception\NotFindClassException
|
||||||
|
* @throws \ReflectionException
|
||||||
*/
|
*/
|
||||||
public static function execute(mixed $params, mixed $class, mixed $method = null): Router
|
public static function execute(mixed $params, mixed $class, mixed $method = null): Router
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ use Kiri\Kiri;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param static $params
|
||||||
* @param mixed $class
|
* @param mixed $class
|
||||||
* @param mixed|null $method
|
* @param mixed|null $method
|
||||||
* @return Router
|
* @return Router
|
||||||
|
|||||||
Reference in New Issue
Block a user