diff --git a/Kiri.php b/Kiri.php index 11ab0db9..d835b148 100644 --- a/Kiri.php +++ b/Kiri.php @@ -23,14 +23,9 @@ use Swoole\WebSocket\Server; defined('DB_ERROR_BUSY') or define('DB_ERROR_BUSY', 'The database is busy. Please try again later.'); defined('SELECT_IS_NULL') or define('SELECT_IS_NULL', 'Query data does not exist, please check the relevant conditions.'); defined('PARAMS_IS_NULL') or define('PARAMS_IS_NULL', 'Required items cannot be empty, please add.'); -defined('CONTROLLER_PATH') or define('CONTROLLER_PATH', APP_PATH . 'app/Controllers/'); -defined('CRONTAB_PATH') or define('CRONTAB_PATH', APP_PATH . 'app/Crontab/'); -defined('CLIENT_PATH') or define('CLIENT_PATH', APP_PATH . 'app/Client/'); -defined('TASK_PATH') or define('TASK_PATH', APP_PATH . 'app/Async/'); -defined('LISTENER_PATH') or define('LISTENER_PATH', APP_PATH . 'app/Listener/'); -defined('KAFKA_PATH') or define('KAFKA_PATH', APP_PATH . 'app/Kafka/'); -defined('RPC_CLIENT_PATH') or define('RPC_CLIENT_PATH', APP_PATH . 'app/Client/Rpc/'); -defined('MODEL_PATH') or define('MODEL_PATH', APP_PATH . 'app/Model/'); +defined('CONTROLLER_PATH') or define('CONTROLLER_PATH', APP_PATH . 'controllers/'); +defined('MODEL_PATH') or define('MODEL_PATH', APP_PATH . 'models/'); +defined('COMPONENT_PATH') or define('COMPONENT_PATH', APP_PATH . 'components/'); /** diff --git a/kiri-engine/Application.php b/kiri-engine/Application.php index 770eec3d..6bf1fa15 100644 --- a/kiri-engine/Application.php +++ b/kiri-engine/Application.php @@ -13,23 +13,22 @@ namespace Kiri; use Closure; use Database\DatabasesProviders; use Exception; +use Kiri; use Kiri\Abstracts\{BaseApplication, Config, Kernel}; use Kiri\Crontab\CrontabProviders; use Kiri\Events\{OnAfterCommandExecute, OnBeforeCommandExecute}; use Kiri\FileListen\HotReload; -use ReflectionException; use Kiri\Server\ServerProviders; +use ReflectionException; use stdClass; use Swoole\Process; use Swoole\Timer; use Symfony\Component\Console\{Application as ConsoleApplication, Command\Command, Input\ArgvInput, - Input\InputInterface, Output\ConsoleOutput, Output\OutputInterface }; -use Kiri; /** @@ -231,7 +230,8 @@ class Application extends BaseApplication { fire(new OnBeforeCommandExecute()); if (!($class instanceof HotReload)) { - scan_directory(directory('app'), 'App'); + scan_directory(COMPONENT_PATH, 'app\Components'); + scan_directory(MODEL_PATH, 'app\Model'); } $this->container->setBindings(OutputInterface::class, $output); diff --git a/kiri-engine/Di/Container.php b/kiri-engine/Di/Container.php index 165118a3..5100b3df 100644 --- a/kiri-engine/Di/Container.php +++ b/kiri-engine/Di/Container.php @@ -21,7 +21,6 @@ use ReflectionException; use ReflectionFunction; use ReflectionMethod; use ReflectionProperty; -use static; /** * Class Container