swoole-framwork/boot.php

28 lines
582 B
PHP
Raw Normal View History

2024-05-20 11:51:07 +08:00
<?php
require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__."/app/config/define.php";
use Core\server\HttpServer;
use Swoole\Process;
if ($argc==2){
$cmd = $argv[1];
if ($cmd=='start'){
//
//$http = \Core\BeanFactory::getBean('HttpServer');
$http = new HttpServer('first');
$http->run();
} elseif ($cmd=='stop'){
$mid = intval(file_get_contents("./ttt.pid"));
if (trim($mid)){
Process::kill($mid);
}
} else {
echo '无效命令';
}
} else {
echo '无效命令';
}