改名
This commit is contained in:
+20
-3
@@ -11,11 +11,13 @@ namespace Kiri;
|
|||||||
|
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Console\CommandInterface;
|
||||||
use Console\Console;
|
use Console\Console;
|
||||||
use Console\ConsoleProviders;
|
use Console\ConsoleProviders;
|
||||||
use Database\DatabasesProviders;
|
use Database\DatabasesProviders;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Http\Context\Response;
|
use Http\Context\Response;
|
||||||
|
use Http\Server;
|
||||||
use Http\ServerProviders;
|
use Http\ServerProviders;
|
||||||
use Kiri\Abstracts\BaseApplication;
|
use Kiri\Abstracts\BaseApplication;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
@@ -86,6 +88,8 @@ class Application extends BaseApplication
|
|||||||
{
|
{
|
||||||
$manager = di(ServerManager::class);
|
$manager = di(ServerManager::class);
|
||||||
$manager->addProcess(FileChangeCustomProcess::class);
|
$manager->addProcess(FileChangeCustomProcess::class);
|
||||||
|
|
||||||
|
putenv('enableFileChange=on');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -161,14 +165,14 @@ class Application extends BaseApplication
|
|||||||
* @return void
|
* @return void
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function start(Input $argv): void
|
public function execute(Input $argv): void
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
/** @var Console $manager */
|
|
||||||
$manager = Kiri::app()->get('console');
|
$manager = Kiri::app()->get('console');
|
||||||
$manager->register(Runtime::class);
|
|
||||||
$class = $manager->setParameters($argv)->search();
|
$class = $manager->setParameters($argv)->search();
|
||||||
|
|
||||||
|
$this->enableFileChange($class);
|
||||||
|
|
||||||
$data = $this->getBuilder($manager->exec($class));
|
$data = $this->getBuilder($manager->exec($class));
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
$data = $this->getBuilder(logger()->exception($exception));
|
$data = $this->getBuilder(logger()->exception($exception));
|
||||||
@@ -179,6 +183,19 @@ class Application extends BaseApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws NotFindClassException
|
||||||
|
* @throws ReflectionException
|
||||||
|
*/
|
||||||
|
private function enableFileChange($class): void
|
||||||
|
{
|
||||||
|
$this->register(Runtime::class);
|
||||||
|
if (env('enableFileChange', 'off') == 'off' || !($class instanceof Server)) {
|
||||||
|
scan_directory(directory('app'), 'App');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return Response|ResponseInterface
|
* @return Response|ResponseInterface
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class Server extends HttpService
|
|||||||
{
|
{
|
||||||
|
|
||||||
private array $process = [
|
private array $process = [
|
||||||
Biomonitoring::class,
|
|
||||||
LoggerProcess::class
|
LoggerProcess::class
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user