改名
This commit is contained in:
@@ -10,13 +10,12 @@ declare(strict_types=1);
|
||||
namespace Snowflake;
|
||||
|
||||
|
||||
use Annotation\Aspect;
|
||||
use Closure;
|
||||
use Console\Console;
|
||||
use Console\ConsoleProviders;
|
||||
use Database\DatabasesProviders;
|
||||
use Database\InjectProperty;
|
||||
use Exception;
|
||||
use HttpServer\Command;
|
||||
use HttpServer\ServerProviders;
|
||||
use Snowflake\Abstracts\BaseApplication;
|
||||
use Snowflake\Abstracts\Config;
|
||||
@@ -26,6 +25,7 @@ use Snowflake\Crontab\CrontabProviders;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use stdClass;
|
||||
use Swoole\Timer;
|
||||
use Wchat\WchatProviders;
|
||||
|
||||
/**
|
||||
* Class Init
|
||||
@@ -33,6 +33,7 @@ use Swoole\Timer;
|
||||
* @package Snowflake
|
||||
*
|
||||
* @property-read Config $config
|
||||
* @property-read WchatProviders $wchat
|
||||
*/
|
||||
class Application extends BaseApplication
|
||||
{
|
||||
@@ -141,6 +142,9 @@ class Application extends BaseApplication
|
||||
$manager->register(Runtime::class);
|
||||
$manager->setParameters($argv);
|
||||
$class = $manager->search();
|
||||
if (!($class instanceof Command)) {
|
||||
scan_directory(APP_PATH, 'APP');
|
||||
}
|
||||
response()->send($manager->execCommand($class));
|
||||
} catch (\Throwable $exception) {
|
||||
response()->send(implode("\n", [
|
||||
|
||||
+17
-2
@@ -80,6 +80,22 @@ if (!function_exists('annotation')) {
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('scan_directory')) {
|
||||
|
||||
|
||||
/**
|
||||
* @param $dir
|
||||
* @param $namespace
|
||||
* @throws Exception
|
||||
*/
|
||||
function scan_directory($dir, $namespace)
|
||||
{
|
||||
\annotation()->read($dir, $namespace);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('swoole')) {
|
||||
|
||||
|
||||
@@ -312,8 +328,7 @@ if (!function_exists('redis')) {
|
||||
|
||||
|
||||
/**
|
||||
* @param string $messages
|
||||
* @param string $category
|
||||
* @return \Snowflake\Cache\Redis|Redis
|
||||
* @throws Exception
|
||||
*/
|
||||
function redis(): \Snowflake\Cache\Redis|Redis
|
||||
|
||||
Reference in New Issue
Block a user