This commit is contained in:
2021-08-16 17:23:21 +08:00
parent 93aa4bd23f
commit 01f6491421
3 changed files with 18 additions and 18 deletions
+14 -14
View File
@@ -548,20 +548,20 @@ class Router extends HttpService implements RouterInterface
public function _loader()
{
$this->loadRouteDir(APP_PATH . 'routes');
$classes = Kiri::getAnnotation()->runtime(CONTROLLER_PATH);
$di = Kiri::getDi();
foreach ($classes as $class) {
$methods = $di->getMethodAttribute($class);
foreach ($methods as $method => $attribute) {
if (empty($attribute)) {
continue;
}
foreach ($attribute as $item) {
$item->execute($class, $method);
}
}
}
// $classes = Kiri::getAnnotation()->runtime(CONTROLLER_PATH);
//
// $di = Kiri::getDi();
// foreach ($classes as $class) {
// $methods = $di->getMethodAttribute($class);
// foreach ($methods as $method => $attribute) {
// if (empty($attribute)) {
// continue;
// }
// foreach ($attribute as $item) {
// $item->execute($class, $method);
// }
// }
// }
}
/**
+1 -1
View File
@@ -54,7 +54,7 @@ class OnServerWorker extends \Server\Abstracts\Server
$this->eventDispatch->dispatch(new OnWorkerStart($server, $workerId));
$this->workerInitExecutor($server, $annotation, $workerId);
$this->interpretDirectory($annotation);
// $this->interpretDirectory($annotation);
$this->eventDispatch->dispatch(new OnAfterWorkerStart());
}
+3 -3
View File
@@ -153,9 +153,9 @@ class Application extends BaseApplication
$manager = Kiri::app()->get('console');
$manager->register(Runtime::class);
$class = $manager->setParameters($argv)->search();
if (!($class instanceof Command)) {
scan_directory(directory('app'), 'App');
}
// if (!($class instanceof Command)) {
scan_directory(directory('app'), 'App');
// }
$data = di(Response::class)->getBuilder($manager->execCommand($class));
} catch (\Throwable $exception) {
$data = di(Response::class)->getBuilder(logger()->exception($exception));