public static function stop($mode = 1)
    {
        $ok = Bootstrap::$pid && posix_kill(
                Bootstrap::$pid,
                $mode === 3 ? SIGINT : (($mode === 4) ? SIGTSTP : SIGTERM)
            );

        if (!$ok) {
            echo '[WARN]. It seems that phpDaemon is not running' . (Bootstrap::$pid ? ' (PID ' . Bootstrap::$pid . ')' : '') . ".\n";
        }

        if ($ok && ($mode > 1)) {
            $i = 0;

            while ($r = Thread\Generic::ifExistsByPid(Bootstrap::$pid)) {
                usleep(10000);
                ++$i;
            }
        }
    }
public static function stop($mode = 1)
    {
        $ok = Bootstrap::$pid && posix_kill(
                Bootstrap::$pid,
                $mode === 3 ? SIGINT : (($mode === 4) ? SIGTSTP : SIGTERM)
            );

        if (!$ok) {
            echo '[WARN]. It seems that phpDaemon is not running' . (Bootstrap::$pid ? ' (PID ' . Bootstrap::$pid . ')' : '') . ".\n";
        }

        if ($ok && ($mode > 1)) {
            $i = 0;

            while ($r = Thread\Generic::ifExistsByPid(Bootstrap::$pid)) {
                usleep(10000);
                ++$i;
            }
        }
    }
public static function stop ( $ mode = 1 ) { $ ok = Bootstrap :: $ pid && posix_kill ( Bootstrap :: $ pid , $ mode === 3 ? SIGINT : ( ( $ mode === 4 ) ? SIGTSTP : SIGTERM ) ) ; if ( ! $ ok ) { echo '[WARN]. It seems that phpDaemon is not running' . ( Bootstrap :: $ pid ? ' (PID ' . Bootstrap :: $ pid . ')' : '' ) . ".\n" ; } if ( $ ok && ( $ mode > 1 ) ) { $ i = 0 ; while ( $ r = Thread \ Generic :: ifExistsByPid ( Bootstrap :: $ pid ) ) { usleep ( 10000 ) ; ++ $ i ; } } }
Stop script.
@param int $mode
@return void
Stop script .