改名
This commit is contained in:
@@ -57,7 +57,7 @@ abstract class AbstractConsole extends Component
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function execCommand(Command $command): mixed
|
public function exec(Command $command): mixed
|
||||||
{
|
{
|
||||||
fire(new OnBeforeCommandExecute());
|
fire(new OnBeforeCommandExecute());
|
||||||
|
|
||||||
|
|||||||
+17
-3
@@ -15,7 +15,6 @@ use Console\Console;
|
|||||||
use Console\ConsoleProviders;
|
use Console\ConsoleProviders;
|
||||||
use Database\DatabasesProviders;
|
use Database\DatabasesProviders;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Http\Command;
|
|
||||||
use Http\Context\Response;
|
use Http\Context\Response;
|
||||||
use Http\ServerProviders;
|
use Http\ServerProviders;
|
||||||
use Kiri\Abstracts\BaseApplication;
|
use Kiri\Abstracts\BaseApplication;
|
||||||
@@ -24,6 +23,7 @@ use Kiri\Abstracts\Input;
|
|||||||
use Kiri\Abstracts\Kernel;
|
use Kiri\Abstracts\Kernel;
|
||||||
use Kiri\Crontab\CrontabProviders;
|
use Kiri\Crontab\CrontabProviders;
|
||||||
use Kiri\Exception\NotFindClassException;
|
use Kiri\Exception\NotFindClassException;
|
||||||
|
use Server\ResponseInterface;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use Swoole\Timer;
|
use Swoole\Timer;
|
||||||
|
|
||||||
@@ -156,15 +156,29 @@ class Application extends BaseApplication
|
|||||||
// if (!($class instanceof Command)) {
|
// if (!($class instanceof Command)) {
|
||||||
scan_directory(directory('app'), 'App');
|
scan_directory(directory('app'), 'App');
|
||||||
// }
|
// }
|
||||||
$data = di(Response::class)->getBuilder($manager->execCommand($class));
|
$data = $this->getBuilder($manager->exec($class));
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
$data = di(Response::class)->getBuilder(logger()->exception($exception));
|
$data = $this->getBuilder(logger()->exception($exception));
|
||||||
} finally {
|
} finally {
|
||||||
print_r($data);
|
print_r($data);
|
||||||
Timer::clearAll();
|
Timer::clearAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $data
|
||||||
|
* @return Response|ResponseInterface
|
||||||
|
* @throws NotFindClassException
|
||||||
|
* @throws \ReflectionException
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private function getBuilder($data): Response|ResponseInterface
|
||||||
|
{
|
||||||
|
return di(Response::class)->getBuilder($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $className
|
* @param $className
|
||||||
* @param null $abstracts
|
* @param null $abstracts
|
||||||
|
|||||||
Reference in New Issue
Block a user