update to 3.0.0-alpha2 (build 610): refactor driver

This commit is contained in:
crazywhalecc
2022-08-01 16:31:54 +08:00
committed by Jerry Ma
parent f2a12634a4
commit 41b058aeaf
186 changed files with 1922 additions and 15444 deletions

View File

@@ -8,7 +8,7 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use ZM\Exception\ZMKnownException;
use ZM\Utils\Manager\ProcessManager;
use ZM\Process\ProcessStateManager;
abstract class ServerCommand extends Command
{
@@ -19,11 +19,12 @@ abstract class ServerCommand extends Command
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$file = ProcessManager::getProcessState(ZM_PROCESS_MASTER);
$file = ProcessStateManager::getProcessState(ZM_PROCESS_MASTER);
/* @noinspection PhpComposerExtensionStubsInspection */
if ($file === false || posix_getsid(intval($file['pid'])) === false) {
$output->writeln('<comment>未检测到正在运行的守护进程或框架进程!</comment>');
if (ProcessManager::isStateEmpty()) {
ProcessManager::removeProcessState(ZM_PROCESS_MASTER);
if (ProcessStateManager::isStateEmpty()) {
ProcessStateManager::removeProcessState(ZM_PROCESS_MASTER);
} else {
$output->writeln('<comment>检测到可能残留的守护进程或框架进程请使用命令关闭server:stop --force</comment>');
}