当前位置: 首页>>代码示例>>PHP>>正文


PHP stop函数代码示例

本文整理汇总了PHP中stop函数的典型用法代码示例。如果您正苦于以下问题:PHP stop函数的具体用法?PHP stop怎么用?PHP stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了stop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的stop函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。