예제 #1
0
파일: swoole.php 프로젝트: rockylo/tsf
function StartServ($phpStart, $cmd, $name)
{
    $process = new swoole_process(function (swoole_process $worker) use($name, $cmd, $phpStart) {
        //目前指支持一个
        $worker->exec($phpStart, array(STARTBASEPATH . "/lib/Swoole/shell/start.php", $cmd, $name));
        //拉起server
        StartLogTimer(__LINE__ . '   ' . $phpStart . ' ' . STARTBASEPATH . '/lib/Swoole/shell/start.php ' . $cmd . ' ' . $name);
    }, false);
    $pid = $process->start();
    $exeRet = swoole_process::wait();
    return;
}
예제 #2
0
파일: swoole.php 프로젝트: delphinBlue/tsf
function StartServ($phpStart, $cmd, $name)
{
    $process = new swoole_process(function (swoole_process $worker) use($name, $cmd, $phpStart) {
        //目前指支持一个
        $worker->exec($phpStart, array(STARTBASEPATH . "/lib/Swoole/shell/start.php", $cmd, $name));
        //拉起server
        StartLogTimer(__LINE__ . '   ' . $phpStart . ' ' . STARTBASEPATH . '/lib/Swoole/shell/start.php ' . $cmd . ' ' . $name);
    }, false);
    $pid = $process->start();
    $exeRet = swoole_process::wait();
    if ($exeRet['code']) {
        //创建失败
        StartLog(" startall   [FAIL] " . PHP_EOL);
        return false;
    } else {
        StartLog(" startall   [SUCCESS] " . PHP_EOL);
        return true;
    }
}