qqq
This commit is contained in:
@@ -4,7 +4,6 @@ namespace Kiri\Server\Abstracts;
|
||||
|
||||
use Exception;
|
||||
use Kiri;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Abstracts\Logger;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
@@ -76,7 +75,7 @@ class AsyncServer implements ServerInterface
|
||||
*/
|
||||
private function initRpcListen(): void
|
||||
{
|
||||
$rpcService = Config::get('rpc', []);
|
||||
$rpcService = \config('rpc', []);
|
||||
if (!empty($rpcService)) {
|
||||
$this->addListener(instance(SConfig::class, [], $rpcService));
|
||||
}
|
||||
@@ -123,7 +122,7 @@ class AsyncServer implements ServerInterface
|
||||
throw new NotFindClassException('Unknown server type ' . $config->type);
|
||||
}
|
||||
$this->initServer($match, $config, $daemon);
|
||||
$this->onEventListen($this->server, Config::get('server.events', []));
|
||||
$this->onEventListen($this->server, \config('server.events', []));
|
||||
$this->onEventListen($this->server, $config->events);
|
||||
$this->onTaskListen();
|
||||
}
|
||||
@@ -175,7 +174,7 @@ class AsyncServer implements ServerInterface
|
||||
*/
|
||||
protected function systemConfig(SConfig $config, int $daemon): array
|
||||
{
|
||||
$settings = array_merge(Config::get('server.settings', []), $config->settings);
|
||||
$settings = array_merge(\config('server.settings', []), $config->settings);
|
||||
$settings[Constant::OPTION_DAEMONIZE] = (bool)$daemon;
|
||||
$settings[Constant::OPTION_ENABLE_REUSE_PORT] = true;
|
||||
$settings[Constant::OPTION_PID_FILE] = storage('.swoole.pid');
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Kiri\Server\Abstracts;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use Kiri;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Server\Contract\OnProcessInterface;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
@@ -186,7 +185,7 @@ class ProcessManager extends Component
|
||||
public function extracted(mixed $custom, Process $process): void
|
||||
{
|
||||
set_env('environmental', Kiri::PROCESS);
|
||||
$system = sprintf('[%s].Custom Process', Config::get('id', 'system-service'));
|
||||
$system = sprintf('[%s].Custom Process', \config('id', 'system-service'));
|
||||
Kiri::getLogger()->alert($system . ' ' . $custom->getName() . ' start.');
|
||||
if (Kiri::getPlatform()->isLinux()) {
|
||||
$process->name($system . '[' . $process->pid . '].' . $custom->getName());
|
||||
|
||||
@@ -64,7 +64,7 @@ trait TraitServer
|
||||
*/
|
||||
public function onSignal(): void
|
||||
{
|
||||
$signal = \Kiri\Abstracts\Config::get('signal', []);
|
||||
$signal = \Kiri\Abstracts\\config('signal', []);
|
||||
$this->onPcntlSignal(SIGINT, [$this, 'onSigint']);
|
||||
foreach ($signal as $sig => $value) {
|
||||
if (is_array($value) && is_string($value[0])) {
|
||||
|
||||
Reference in New Issue
Block a user