From 4a11a0e813b63bd040af31e2cc4241e2ae50c63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 7 Sep 2020 16:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Server.php | 3 +++ function.php | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/HttpServer/Server.php b/HttpServer/Server.php index 97eefce3..81468979 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -251,6 +251,9 @@ class Server extends Application if (!($this->baseServer instanceof \Swoole\Server)) { $class = $this->dispatch($config['type']); $this->baseServer = new $class($config['host'], $config['port'], SWOOLE_PROCESS, $config['mode']); + if (!isset($settings['pid_file'])) { + $settings['pid_file'] = APP_PATH . 'storage/server.pid'; + } $this->baseServer->set($settings); $this->bindAnnotation(); } else { diff --git a/function.php b/function.php index 2de321d8..0b9e3210 100644 --- a/function.php +++ b/function.php @@ -158,11 +158,11 @@ if (!function_exists('storage')) { { $basePath = Snowflake::getStoragePath(); if (empty($path)) { - $fileName = $basePath . '/' . $fileName; + $fileName = rtrim($basePath, '/') . '/' . $fileName; } else if (empty($fileName)) { - $fileName = initDir($basePath, $path); + $fileName = rtrim(initDir($basePath, $path)); } else { - $fileName = initDir($basePath, $path) . '/' . $fileName; + $fileName = rtrim(initDir($basePath, $path)) . '/' . $fileName; } if (!file_exists($fileName)) { touch($fileName); @@ -301,7 +301,6 @@ if (!function_exists('merge')) { } - if (!function_exists('jTraceEx')) { /**