add plugin command bootstrappers

This commit is contained in:
crazywhalecc
2023-03-29 21:31:53 +08:00
committed by Jerry
parent eeb3481c5a
commit 5ac92ae210
4 changed files with 25 additions and 11 deletions

View File

@@ -79,13 +79,13 @@ final class ConsoleApplication extends Application
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output): int
{
// 初始化内核
$kernel = Framework::getInstance();
$kernel->runtime_preferences = $kernel->runtime_preferences
$framework = Framework::getInstance();
$framework->runtime_preferences = $framework->runtime_preferences
->withConfigDir($input->getOption('config-dir'))
->withEnvironment($input->getOption('env'))
->enableDebugMode($input->getOption('debug'))
->withLogLevel($input->getOption('log-level'));
$kernel->bootstrap();
$framework->bootstrap();
return parent::doRunCommand($command, $input, $output);
}