本文整理汇总了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);
}
示例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";
}
}
示例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;
}
}
}
}
示例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);
}
示例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");
}
}
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
}
示例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__);
}
示例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);
}
示例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);
}
示例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;
}
示例15: error
function error($string){
makelog('<<ERROR>>: '.$string);
stop();
DIE();
}