diff --git a/src/Command/DefaultCommand/Crontab.php b/src/Command/DefaultCommand/Crontab.php index 55669b0c..2530199d 100644 --- a/src/Command/DefaultCommand/Crontab.php +++ b/src/Command/DefaultCommand/Crontab.php @@ -38,10 +38,10 @@ public function help(CommandHelpInterface $commandHelp): CommandHelpInterface public function exec(): ?string { - Core::getInstance()->initialize(); $action = CommandManager::getInstance()->getArg(0); $exe = "{$this->commandName()}.{$action}"; Di::getInstance()->set(SysConst::EXECUTE_COMMAND,$exe); + Core::getInstance()->initialize(); $run = new Scheduler(); $run->add(function () use (&$result, $action) { if (method_exists($this, $action) && $action != 'help') { diff --git a/src/Command/DefaultCommand/Process.php b/src/Command/DefaultCommand/Process.php index d22aeb43..fc079ad1 100644 --- a/src/Command/DefaultCommand/Process.php +++ b/src/Command/DefaultCommand/Process.php @@ -42,10 +42,10 @@ public function help(CommandHelpInterface $commandHelp): CommandHelpInterface public function exec(): ?string { - Core::getInstance()->initialize(); $action = CommandManager::getInstance()->getArg(0); $exe = "{$this->commandName()}.{$action}"; Di::getInstance()->set(SysConst::EXECUTE_COMMAND,$exe); + Core::getInstance()->initialize(); $run = new Scheduler(); $run->add(function () use (&$result, $action) { if (method_exists($this, $action) && $action != 'help') { diff --git a/src/Command/DefaultCommand/Task.php b/src/Command/DefaultCommand/Task.php index bc6b8a1d..2a44b3dc 100644 --- a/src/Command/DefaultCommand/Task.php +++ b/src/Command/DefaultCommand/Task.php @@ -35,10 +35,10 @@ public function help(CommandHelpInterface $commandHelp): CommandHelpInterface public function exec(): ?string { - Core::getInstance()->initialize(); $action = CommandManager::getInstance()->getArg(0); $exe = "{$this->commandName()}.{$action}"; Di::getInstance()->set(SysConst::EXECUTE_COMMAND,$exe); + Core::getInstance()->initialize(); $run = new Scheduler(); $run->add(function () use (&$result, $action) { if (method_exists($this, $action) && $action != 'help') {