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