改名
This commit is contained in:
@@ -14,10 +14,12 @@ use Console\ConsoleProviders;
|
||||
use Database\DatabasesProviders;
|
||||
use Exception;
|
||||
use HttpServer\ServerProviders;
|
||||
use Queue\QueueProviders;
|
||||
use Snowflake\Abstracts\BaseApplication;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Swoole\Timer;
|
||||
|
||||
/**
|
||||
@@ -37,6 +39,7 @@ class Application extends BaseApplication
|
||||
|
||||
|
||||
/**
|
||||
* @throws ConfigException
|
||||
* @throws NotFindClassException
|
||||
*/
|
||||
public function init()
|
||||
@@ -44,6 +47,9 @@ class Application extends BaseApplication
|
||||
$this->import(ConsoleProviders::class);
|
||||
$this->import(DatabasesProviders::class);
|
||||
$this->import(ServerProviders::class);
|
||||
if (Config::get('queue.enable', false, false)) {
|
||||
$this->import(QueueProviders::class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ class Logger extends Component
|
||||
/**
|
||||
* @param $messages
|
||||
* @param string $category
|
||||
* @throws Exception
|
||||
* @throws
|
||||
*/
|
||||
public function write(string $messages, $category = 'app')
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ use ReflectionException;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Di\Container;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Process\Process;
|
||||
use Swoole\Coroutine;
|
||||
|
||||
class Snowflake
|
||||
@@ -214,6 +215,23 @@ class Snowflake
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $process
|
||||
* @return mixed|void
|
||||
*/
|
||||
public static function shutdown($process)
|
||||
{
|
||||
static::app()->server->getServer()->shutdown();
|
||||
if ($process instanceof Process) {
|
||||
$process->exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $tmp
|
||||
* @return string
|
||||
*/
|
||||
public static function rename($tmp)
|
||||
{
|
||||
$hash = md5_file($tmp['tmp_name']);
|
||||
|
||||
Reference in New Issue
Block a user