本文整理匯總了PHP中system::kill方法的典型用法代碼示例。如果您正苦於以下問題:PHP system::kill方法的具體用法?PHP system::kill怎麽用?PHP system::kill使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類system
的用法示例。
在下文中一共展示了system::kill方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deamon_stop
public static function deamon_stop()
{
$deamon_info = self::deamon_info();
if ($deamon_info['state'] == 'ok') {
try {
self::callOpenzwave('/ZWaveAPI/Run/network.Stop()', 0, 30000);
} catch (Exception $e) {
}
}
$pid_file = '/tmp/openzwave.pid';
if (file_exists($pid_file)) {
$pid = intval(trim(file_get_contents($pid_file)));
system::kill($pid);
}
system::fuserk(config::byKey('port_server', 'openzwave', 8083));
system::kill('openZWave.py');
}
示例2: deamon_stop
public static function deamon_stop()
{
$General_Debug = config::byKey('generalDebug', 'arduidom', 0, true);
$daemonmode = self::get_daemon_mode();
if ($daemonmode == "KILLING" || $daemonmode == "STARTING") {
if ($General_Debug) {
log::add('arduidom', 'debug', "Another session of stopping daemon in progress... wait 1 minute before retry...");
}
return false;
}
if ($daemonmode != "FLASHING") {
self::set_daemon_mode("KILLING");
}
if ($General_Debug) {
log::add('arduidom', 'debug', "************************* --------------------------------------------------------------------------------------");
}
if ($General_Debug) {
log::add('arduidom', 'debug', "* daemon_stop() called. *");
}
if ($General_Debug) {
log::add('arduidom', 'debug', "*************************");
}
log::add('arduidom', 'info', 'Arret du démon...');
$daemon_path = realpath(dirname(__FILE__) . '/../../ressources');
touch($daemon_path . "/arduidomx.kill");
sleep(1.5);
$pid_file = $daemon_path . "/arduidomx.pid";
if (file_exists($pid_file)) {
$pid = intval(trim(file_get_contents($pid_file)));
if (substr(jeedom::version(), 0, 1) == 2) {
$killresult = system::kill($pid);
if ($General_Debug) {
log::add('arduidom', 'debug', 'system::kill(' . $pid . ") = " . $killresult);
}
}
if ($General_Debug) {
log::add('arduidom', 'debug', "removing file " . $daemon_path . "/arduidomx.pid");
}
unlink($daemon_path . "/arduidomx.pid");
}
if ($General_Debug) {
log::add('arduidom', 'debug', "system::fuserk(" . intval(58201) . ")");
}
if (substr(jeedom::version(), 0, 1) == 2) {
system::fuserk(intval(58201));
}
if ($daemonmode != "FLASHING") {
self::set_daemon_mode("KILLED");
}
return "OK";
}