本文整理汇总了PHP中AJXP_Controller::runCommandInBackground方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Controller::runCommandInBackground方法的具体用法?PHP AJXP_Controller::runCommandInBackground怎么用?PHP AJXP_Controller::runCommandInBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Controller
的用法示例。
在下文中一共展示了AJXP_Controller::runCommandInBackground方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switchWebSocketOn
public function switchWebSocketOn($params)
{
$wDir = $this->getPluginWorkDir(true);
$pidFile = $wDir . DIRECTORY_SEPARATOR . "ws-pid";
if (file_exists($pidFile)) {
$pId = file_get_contents($pidFile);
$unixProcess = new UnixProcess();
$unixProcess->setPid($pId);
$status = $unixProcess->status();
if ($status) {
throw new Exception("Web Socket server seems to already be running!");
}
}
$host = escapeshellarg($params["WS_SERVER_BIND_HOST"]);
$port = escapeshellarg($params["WS_SERVER_BIND_PORT"]);
$path = escapeshellarg($params["WS_SERVER_PATH"]);
$cmd = ConfService::getCoreConf("CLI_PHP") . " ws-server.php -host=" . $host . " -port=" . $port . " -path=" . $path;
chdir(AJXP_INSTALL_PATH . DIRECTORY_SEPARATOR . AJXP_PLUGINS_FOLDER . DIRECTORY_SEPARATOR . "core.mq");
$process = AJXP_Controller::runCommandInBackground($cmd, null);
if ($process != null) {
$pId = $process->getPid();
$wDir = $this->getPluginWorkDir(true);
file_put_contents($wDir . DIRECTORY_SEPARATOR . "ws-pid", $pId);
return "SUCCESS: Started WebSocket Server with process ID {$pId}";
}
return "SUCCESS: Started WebSocket Server";
}
示例2: informWatcher
protected function informWatcher($action, $path)
{
$cmd = "python " . $this->getBaseDir() . "/framework_watch.py --action={$action} --path=" . escapeshellarg($path);
AJXP_Controller::runCommandInBackground($cmd, $this->getBaseDir() . "/cmd.out");
}