Skip to content

Commit

Permalink
fix: exec command const
Browse files Browse the repository at this point in the history
  • Loading branch information
Player626 committed Dec 18, 2020
1 parent 80608a4 commit 84f8be7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Command/DefaultCommand/Crontab.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DefaultCommand/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DefaultCommand/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 84f8be7

Please sign in to comment.