run(); } else if ($cmd == 'stop') { $getpid = intval(file_get_contents("./Buddha.pid")); //获取上一次程序运行的 master_id if ($getpid && trim($getpid) != 0) { Process::kill($getpid); echo "stop success" . PHP_EOL; } } else if ($cmd == 'restart') { $getpid = intval(file_get_contents("./Buddha.pid")); //获取上一次程序运行的 master_id if ($getpid && trim($getpid) != 0) { Process::kill($getpid); sleep(1); $http = new Core\server\HttpServer('first'); echo "restart done" . PHP_EOL; $http->run(); } else { echo "restart the failure" . PHP_EOL; } } else { echo '无效命令'; } }