This commit is contained in:
2021-08-13 14:58:58 +08:00
parent 15851ba97c
commit 2432b98be5
13 changed files with 90 additions and 151 deletions
+4 -2
View File
@@ -9,6 +9,8 @@ use Kiri\Abstracts\Component;
use Kiri\Abstracts\Input;
use Kiri\Event;
use Kiri\Kiri;
use Server\Events\OnAfterCommandExecute;
use Server\Events\OnBeforeCommandExecute;
/**
* Class AbstractConsole
@@ -58,11 +60,11 @@ abstract class AbstractConsole extends Component
*/
public function execCommand(Command $command): mixed
{
fire(Event::BEFORE_COMMAND_EXECUTE);
fire(new OnBeforeCommandExecute());
$data = $command->onHandler($this->parameters);
fire(Event::AFTER_COMMAND_EXECUTE, [$data]);
fire(new OnAfterCommandExecute($data));
return $data;
}