改名
This commit is contained in:
@@ -53,28 +53,7 @@ class Command extends \Console\Command
|
|||||||
return 'shutdown success.';
|
return 'shutdown success.';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->scan_system_annotation();
|
|
||||||
|
|
||||||
return $manager->start();
|
return $manager->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws ReflectionException
|
|
||||||
* @throws ComponentException
|
|
||||||
* @throws NotFindPropertyException
|
|
||||||
*/
|
|
||||||
public function scan_system_annotation()
|
|
||||||
{
|
|
||||||
$annotation = Snowflake::app()->getAttributes();
|
|
||||||
$annotation->readControllers(__DIR__ . '/../Console', 'Console', 'system');
|
|
||||||
$annotation->readControllers(__DIR__ . '/../Database', 'Database', 'system');
|
|
||||||
$annotation->readControllers(__DIR__ . '/../Gii', 'Gii', 'system');
|
|
||||||
$annotation->readControllers(__DIR__ . '/../HttpServer', 'HttpServer', 'system');
|
|
||||||
$annotation->readControllers(__DIR__ . '/../Kafka', 'Kafka', 'system');
|
|
||||||
$annotation->readControllers(__DIR__ . '/../System', 'Snowflake', 'system');
|
|
||||||
$annotation->readControllers(__DIR__ . '/../Validator', 'Validator', 'system');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ use Console\ConsoleProviders;
|
|||||||
use Database\DatabasesProviders;
|
use Database\DatabasesProviders;
|
||||||
use Exception;
|
use Exception;
|
||||||
use HttpServer\ServerProviders;
|
use HttpServer\ServerProviders;
|
||||||
|
use ReflectionException;
|
||||||
use Snowflake\Abstracts\BaseApplication;
|
use Snowflake\Abstracts\BaseApplication;
|
||||||
use Snowflake\Abstracts\Config;
|
use Snowflake\Abstracts\Config;
|
||||||
use Snowflake\Abstracts\Input;
|
use Snowflake\Abstracts\Input;
|
||||||
use Snowflake\Abstracts\Kernel;
|
use Snowflake\Abstracts\Kernel;
|
||||||
|
use Snowflake\Exception\ComponentException;
|
||||||
use Snowflake\Exception\NotFindClassException;
|
use Snowflake\Exception\NotFindClassException;
|
||||||
|
use Snowflake\Exception\NotFindPropertyException;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use Swoole\Timer;
|
use Swoole\Timer;
|
||||||
|
|
||||||
@@ -101,6 +104,8 @@ class Application extends BaseApplication
|
|||||||
public function start(Input $argv): bool|string
|
public function start(Input $argv): bool|string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$this->scan_system_annotation();
|
||||||
|
|
||||||
fire(Event::SERVER_BEFORE_START);
|
fire(Event::SERVER_BEFORE_START);
|
||||||
|
|
||||||
$this->set('input', $argv);
|
$this->set('input', $argv);
|
||||||
@@ -120,6 +125,25 @@ class Application extends BaseApplication
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws ReflectionException
|
||||||
|
* @throws ComponentException
|
||||||
|
* @throws NotFindPropertyException
|
||||||
|
*/
|
||||||
|
public function scan_system_annotation()
|
||||||
|
{
|
||||||
|
$annotation = Snowflake::app()->getAttributes();
|
||||||
|
$annotation->readControllers(__DIR__ . '/../Console', 'Console', 'system');
|
||||||
|
$annotation->readControllers(__DIR__ . '/../Database', 'Database', 'system');
|
||||||
|
$annotation->readControllers(__DIR__ . '/../Gii', 'Gii', 'system');
|
||||||
|
$annotation->readControllers(__DIR__ . '/../HttpServer', 'HttpServer', 'system');
|
||||||
|
$annotation->readControllers(__DIR__ . '/../Kafka', 'Kafka', 'system');
|
||||||
|
$annotation->readControllers(__DIR__ . '/../System', 'Snowflake', 'system');
|
||||||
|
$annotation->readControllers(__DIR__ . '/../Validator', 'Validator', 'system');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $className
|
* @param $className
|
||||||
* @param null $abstracts
|
* @param null $abstracts
|
||||||
|
|||||||
Reference in New Issue
Block a user