Files
kiri-core/Server/Abstracts/Server.php
T

50 lines
660 B
PHP
Raw Normal View History

2021-07-19 19:04:13 +08:00
<?php
namespace Server\Abstracts;
use Closure;
use Exception;
2021-08-11 01:04:57 +08:00
use Kiri\Abstracts\Config;
use Kiri\Event;
use Kiri\Exception\ConfigException;
use Kiri\Kiri;
2021-08-03 14:06:47 +08:00
use Swoole\Server\Port;
2021-07-19 19:04:13 +08:00
/**
* Class Server
* @package Server\Abstracts
*/
abstract class Server
{
2021-08-12 14:08:40 +08:00
/**
* @param $prefix
* @throws ConfigException
*/
protected function setProcessName($prefix)
{
if (Kiri::getPlatform()->isMac()) {
return;
}
$name = Config::get('id', 'system-service');
if (!empty($prefix)) {
$name .= '.' . $prefix;
}
swoole_set_process_name($name);
}
2021-07-21 19:05:11 +08:00
/**
* Server constructor.
* @throws Exception
*/
2021-08-12 14:08:40 +08:00
public function __construct()
2021-07-19 19:04:13 +08:00
{
}
}