本文整理汇总了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";
}