本文整理汇总了PHP中stop函数的典型用法代码示例。如果您正苦于以下问题:PHP stop函数的具体用法?PHP stop怎么用?PHP stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stop函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: restart
function restart($nopid = false)
{
$unix = new unix();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
if (!$nopid) {
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
}
@file_put_contents($pidfile, getmypid());
stop(true);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Reconfigure...\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Path: /etc/zarafa/httpd.conf...\n";
}
build();
start(true);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:25,代码来源:exec.zarafa-apache.php
示例2: restart
function restart()
{
$unix = new unix();
$shorewall = $unix->find_program("shorewall");
if (!is_file($shorewall)) {
return;
}
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, Already task running PID {$pid} since {$time}mn\n";
}
return;
}
stop(true);
start(true);
if (is_file("/etc/init.d/ssh")) {
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, restarting SSH service.\n";
}
system("/etc/init.d/ssh restart");
}
if ($GLOBALS["OUTPUT"]) {
echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, ACTION DONE.\n";
}
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:28,代码来源:exec.shorewall.php
示例3: movementLogic
function movementLogic()
{
global $posx, $posy, $serial, $curDirection, $curMove, $direction, $DIYdistance_LEFT, $DIYdistance, $DIYdistance_RIGHT, $carIsRunning;
echo "left " . $DIYdistance_LEFT . "\n";
echo "center" . $DIYdistance . "\n";
echo "right" . $DIYdistance_RIGHT . "\n";
echo "Current" . $curDirection . "\n";
if ($carIsRunning) {
//echo " forward ";
if ($DIYdistance_RIGHT >= OBSTACLE && $DIYdistance_LEFT >= OBSTACLE && $DIYdistance >= OBSTACLE && ($curDirection != 's' && $curDirection != 'a' && $curDirection != 'd')) {
forward();
//
$carIsRunning = TRUE;
} else {
if ($DIYdistance_RIGHT < OBSTACLE && $DIYdistance_LEFT < OBSTACLE && $DIYdistance <= OBSTACLE) {
backward();
$carIsRunning = TRUE;
} else {
stop();
$carIsRunning = TRUE;
//FALSE;
}
}
}
}
开发者ID:MathewStylianidis,项目名称:DIYiotCar,代码行数:25,代码来源:position.php
示例4: restart
function restart($aspid = false)
{
$unix = new unix();
$sock = new sockets();
$Masterbin = $unix->find_program("haproxy");
if (!is_file($Masterbin)) {
if ($GLOBALS["OUTPUT"]) {
echo "ReStarting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, haproxy not installed\n";
}
return;
}
if (!$aspid) {
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "ReStarting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
}
stop(true);
build();
start(true);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:27,代码来源:exec.haproxy.php
示例5: restart
function restart()
{
$unix = new unix();
$sock = new sockets();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
stop(true);
build();
sleep(1);
start(true);
$cicap = $unix->find_program("c-icap");
if (is_file($cicap)) {
$CicapEnabled = intval($sock->GET_INFO("CicapEnabled"));
if ($CicapEnabled == 1) {
system("/etc/init.d/c-icap reload");
}
}
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:exec.clamd.php
示例6: restart
function restart()
{
$unix = new unix();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
build_progress("{stopping_service}", 10);
stop(true);
build_progress("{reconfiguring}", 40);
build();
sleep(1);
build_progress("{starting_service}", 45);
if (!start(true)) {
build_progress("{starting_service} {failed}", 110);
return;
}
system("/etc/init.d/monit restart");
build_progress("{starting_service} {success}", 100);
}
开发者ID:articatech,项目名称:artica,代码行数:26,代码来源:exec.proftpd.php
示例7: restart
function restart()
{
$pid = stop();
// wait for main process to shut down
while ($pid && count(explode("\n", shell_exec("ps --pid " . $pid))) > 2) {
usleep(50000);
}
start();
}
开发者ID:TheProjecter,项目名称:miscellaneousrepo,代码行数:9,代码来源:index.php
示例8: restart
function restart()
{
$unix = new unix();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: Memcached Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
stop(true);
start(true);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:16,代码来源:exec.memcached.php
示例9: restart
function restart()
{
$unix = new unix();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
vsftpd_admin_mysql(1, "Restarting VSFTPD service...", null, __FILE__, __LINE__);
stop(true);
sleep(1);
start(true);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:18,代码来源:exec.vsftpd.php
示例10: movementLogic
function movementLogic()
{
global $posx, $posy, $curMove, $direction, $DIYdistance_LEFT, $DIYdistance, $DIYdistance_RIGHT, $carIsRunning;
echo "logic";
echo $carIsRunning;
if ($carIsRunning) {
echo " forward ";
forward();
/*if ( ( !($DIYdistance_RIGHT < OBSTACLE) || !($DIYdistance_LEFT < OBSTACLE) || !($DIYdistance < OBSTACLE) ) && ( ($curMove != 's') || ($curMove != 'a') || ($curMove != 'd') ) ){
forward();
echo "empros\n";
$carIsRunning = TRUE;
}elseif (($curMove != 'a') && ($DIYdistance_LEFT > $DIYdistance_RIGHT)){
left();
echo "aristera\n";
$carIsRunning = TRUE;
}elseif (($curMove != 'd') && ($DIYdistance_LEFT < $DIYdistance_RIGHT)){
right();
echo "dexia\n";
$carIsRunning = TRUE;
}elseif ( ($DIYdistance_RIGHT < OBSTACLE) && ($DIYdistance_LEFT < OBSTACLE) && ($DIYdistance < OBSTACLE) ) {
stop();
echo "stop\n";
$carIsRunning = false;
}
else{
forward();
echo "piso\n";
$carIsRunning = TRUE;
}*/
} else {
stop();
echo "Stops from position.php";
$carIsRunning = TRUE;
}
}
开发者ID:alexdimitriou,项目名称:DIYiotCar,代码行数:44,代码来源:position.php
示例11: restart
function restart()
{
$unix = new unix();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
squid_admin_mysql(1, "HAARP: Restart operation ordered", "{$GLOBALS["RGVS"]}");
stop(true);
sleep(1);
start(true);
$squidbin = $unix->LOCATE_SQUID_BIN();
squid_admin_mysql(1, "Reconfiguring proxy service", null, __FILE__, __LINE__);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:20,代码来源:exec.haarp.php
示例12: upcoming_attendees_html
function upcoming_attendees_html($event, $types = array('attend'))
{
$yql = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%20%3D%20%22http%3A%2F%2Fupcoming.yahoo.com%2Fajax%2Fevent_page_all_attendees.php%3Fevent_id%3D{$event}%22%3B&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env&callback=";
$json = file_get_contents($yql);
$json = json_decode($json);
if (!$json || !is_object($json)) {
stop('Bad YQL response', 500);
}
$results = $json->query->results;
if (!$results) {
stop('Event not found', 404);
}
$html = '';
foreach ($types as $type) {
$html .= $results->rsp->{$type} . "\n";
}
if (!$html) {
stop('Bad YQL data structure', 500);
}
return html_entity_decode($html);
}
开发者ID:reid,项目名称:upcoming-attendees,代码行数:21,代码来源:ws.php
示例13: restart
function restart()
{
$unix = new unix();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Restarting....: [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
$pid = PID_NUM();
if ($unix->process_exists($pid)) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Restarting....: [INIT]: {$GLOBALS["TITLENAME"]} PID {$pid} running since {$time}mn\n";
}
}
stop(true);
sleep(1);
start(true);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:24,代码来源:exec.syslog-init.php
示例14: getDataJSON
function getDataJSON($user = null)
{
global $username, $conn, $ustabl;
if ($user == null) {
$user = $username;
}
$login = loginstatus();
if ($login['username'] != $user && $login['isAdmin'] != "true") {
stop('E0.0.1', "You're not logged in like that!");
}
$sql = "SELECT data FROM {$ustabl} WHERE username='{$user}'";
$result = $conn->query($sql);
if ($result->num_rows == 0) {
stop('E0.1', "Username not known. [{$user}]");
// E1*
}
if ($result->num_rows > 1) {
stop('E0.2', "Internal error!");
// E2*
}
$data = $result->fetch_assoc()['data'];
// We're sure to get 1 line
return $data;
}
开发者ID:C-Bouthoorn,项目名称:SpeedProgramming,代码行数:24,代码来源:userdata.php
示例15: error
function error($string){
makelog('<<ERROR>>: '.$string);
stop();
DIE();
}
开发者ID:xl7dev,项目名称:WebShell,代码行数:5,代码来源:Antichat+Socks5+Server+v+1.0.php
示例16: start
function start($aspid = false)
{
$unix = new unix();
$sock = new sockets();
$Masterbin = $unix->find_program("pdns_server");
$PowerDNSLogLevel = $sock->GET_INFO("PowerDNSLogLevel");
$PowerDNSDNSSEC = $sock->GET_INFO("PowerDNSDNSSEC");
$PowerDNSLogsQueries = $sock->GET_INFO("PowerDNSLogsQueries");
if (!is_numeric($PowerDNSLogLevel)) {
$PowerDNSLogLevel = 0;
}
if (!is_numeric($PowerDNSDNSSEC)) {
$PowerDNSDNSSEC = 0;
}
if (!is_numeric($PowerDNSLogsQueries)) {
$PowerDNSLogsQueries = 0;
}
if (!is_file($Masterbin)) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, not installed\n";
}
return;
}
if (!$aspid) {
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
}
$pid = PID_NUM();
$EnablePDNS = $sock->GET_INFO("EnablePDNS");
if (!is_numeric($EnablePDNS)) {
$EnablePDNS = 0;
}
if ($EnablePDNS == 0) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} service disabled (see EnablePDNS)\n";
}
stop(true);
return;
}
if ($unix->process_exists($pid)) {
$timepid = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Service already started {$pid} since {$timepid}Mn...\n";
}
return;
}
if (!is_file("/usr/lib/libboost_serialization.so.1.49.0")) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: Please wait, installing libboost-serialization1.49.0\n";
}
$unix->DEBIAN_INSTALL_PACKAGE("libboost-serialization1.49.0");
}
$php5 = $unix->LOCATE_PHP5_BIN();
$sysctl = $unix->find_program("sysctl");
$echo = $unix->find_program("echo");
$nohup = $unix->find_program("nohup");
$dnsmasq_bin = $unix->find_program("dnsmasq");
$kill = $unix->find_program("kill");
if (is_file($dnsmasq_bin)) {
$dnsmasq_pid = $unix->PIDOF($dnsmasq_bin);
if ($unix->process_exists($dnsmasq_pid)) {
unix_system_kill_force($dnsmasq_pid);
}
}
@mkdir("/var/run/pdns", 0755, true);
$t = explode("\n", @file_get_contents("/etc/powerdns/pdns.conf"));
while (list($index, $ligne) = each($t)) {
if (preg_match("#^recursor=(.+)\$#", $ligne, $re)) {
$recursor = trim($re[1]);
break;
}
}
$PowerDNSPerfs = unserialize(base64_encode($sock->GET_INFO("PowerDNSPerfs")));
if (!isset($PowerDNSPerfs["cache-ttl"])) {
$PowerDNSPerfs["cache-ttl"] = 3600;
}
if (!isset($PowerDNSPerfs["negquery-cache-ttl"])) {
$PowerDNSPerfs["negquery-cache-ttl"] = 7200;
}
if (!isset($PowerDNSPerfs["query-cache-ttl"])) {
$PowerDNSPerfs["query-cache-ttl"] = 300;
}
if (!isset($PowerDNSPerfs["recursive-cache-ttl"])) {
$PowerDNSPerfs["recursive-cache-ttl"] = 7200;
}
if (!is_numeric($PowerDNSPerfs["negquery-cache-ttl"])) {
$PowerDNSPerfs["negquery-cache-ttl"] = 7200;
}
if (!is_numeric($PowerDNSPerfs["query-cache-ttl"])) {
$PowerDNSPerfs["query-cache-ttl"] = 300;
}
if (!is_numeric($PowerDNSPerfs["recursive-cache-ttl"])) {
//.........这里部分代码省略.........
开发者ID:articatech,项目名称:artica,代码行数:101,代码来源:exec.pdns_server.php
示例17: stop
}
}
break;
case 'wipe':
// Removing temporary files
if (isset($node_id)) {
// Node ID is set, stop and wipe the node
stop($lab->getNodes()[$node_id]);
$cmd = 'rm -rf "/opt/unetlab/tmp/' . $tenant . '/' . $lab->getId() . '/' . $node_id . '/"';
exec($cmd, $o, $rc);
if ($rc !== 0) {
error_log(date('M d H:i:s ') . date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][13]);
error_log(date('M d H:i:s ') . date('M d H:i:s ') . implode("\n", $o));
exit(13);
}
} else {
// Node ID is not set, stop and wipe all nodes
foreach ($lab->getNodes() as $node_id => $node) {
stop($node);
}
$cmd = 'rm -rf "/opt/unetlab/tmp/' . $tenant . '/' . $lab->getId() . '/"';
exec($cmd, $o, $rc);
if ($rc !== 0) {
error_log(date('M d H:i:s ') . date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][13]);
error_log(date('M d H:i:s ') . date('M d H:i:s ') . implode("\n", $o));
exit(13);
}
}
break;
}
exit(0);
开发者ID:dunice-valentin,项目名称:unetlab,代码行数:31,代码来源:unl_wrapper.php
示例18: clean
function clean($aspid = false)
{
$unix = new unix();
$sock = new sockets();
$pidfile = "/etc/artica-postfix/pids/zarafa-search-starter.pid";
if (!$aspid) {
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Engine Artica Task Already running PID {$pid} since {$time}mn\n";
}
return;
}
}
@file_put_contents($pidfile, getmypid());
$ZarafaIndexPath = $sock->GET_INFO("ZarafaIndexPath");
if ($ZarafaIndexPath == null) {
$ZarafaIndexPath = "/var/lib/zarafa/index";
}
$rm = $unix->find_program("rm");
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} directory {$ZarafaIndexPath}\n";
}
stop(true);
recursive_remove_directory($ZarafaIndexPath, true);
start(true);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:28,代码来源:exec.zarafa-search.php
示例19: restart
function restart()
{
stop();
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, build_index_page();\n";
build_index_page();
start();
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:7,代码来源:exec.sarg.php
示例20: shutdown
function shutdown()
{
// This is our shutdown function, in
// here we can do any last operations
// before the script is complete.
stop();
exec("echo q > /dev/ttymotor");
echo "Script executed with success";
}
开发者ID:alexdimitriou,项目名称:DIYiotCar,代码行数:9,代码来源:stavros_controller.php
注:本文中的stop函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论