改名
This commit is contained in:
@@ -5,6 +5,8 @@ namespace HttpServer;
|
|||||||
|
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Snowflake\Abstracts\Input;
|
||||||
|
use Snowflake\Exception\ComponentException;
|
||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
use Swoole\WebSocket\Server;
|
use Swoole\WebSocket\Server;
|
||||||
|
|
||||||
@@ -28,7 +30,6 @@ trait Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \HttpServer\Server $socket
|
* @param \HttpServer\Server $socket
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
@@ -97,9 +98,15 @@ trait Action
|
|||||||
/**
|
/**
|
||||||
* @param $port
|
* @param $port
|
||||||
* @return bool|array
|
* @return bool|array
|
||||||
|
* @throws ComponentException
|
||||||
*/
|
*/
|
||||||
private function isUse($port)
|
private function isUse($port)
|
||||||
{
|
{
|
||||||
|
/** @var Input $input */
|
||||||
|
$input = Snowflake::app()->get('input');
|
||||||
|
if (in_array($input->get('action'), ['start', 'restart'])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (empty($port)) {
|
if (empty($port)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ class Application extends BaseApplication
|
|||||||
*/
|
*/
|
||||||
public function start(Input $argv)
|
public function start(Input $argv)
|
||||||
{
|
{
|
||||||
|
$this->set('input', $argv);
|
||||||
$manager = Snowflake::app()->server;
|
$manager = Snowflake::app()->server;
|
||||||
$manager->setDaemon($argv->get('daemon', 0));
|
$manager->setDaemon($argv->get('daemon', 0));
|
||||||
switch ($argv->get('action')) {
|
switch ($argv->get('action')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user