private function daemonize()
    {
        // prevent permission issues
        umask(0);

        $pid = pcntl_fork();
        if ($pid == -1) {
            /* fork failed */
            throw new \RuntimeException('Failed to fork the daemon.');
        } elseif ($pid) {
            /* close the parent */
            return false;
        }

        // make ourselves the session leader
        if (posix_setsid() == -1) {
            throw new \RuntimeException('Failed to become a daemon.');
        }

        return true;
    }
private function daemonize()
    {
        // prevent permission issues
        umask(0);

        $pid = pcntl_fork();
        if ($pid == -1) {
            /* fork failed */
            throw new \RuntimeException('Failed to fork the daemon.');
        } elseif ($pid) {
            /* close the parent */
            return false;
        }

        // make ourselves the session leader
        if (posix_setsid() == -1) {
            throw new \RuntimeException('Failed to become a daemon.');
        }

        return true;
    }
private function daemonize ( ) { // prevent permission issues umask ( 0 ) ; $ pid = pcntl_fork ( ) ; if ( $ pid == - 1 ) { /* fork failed */ throw new \ RuntimeException ( 'Failed to fork the daemon.' ) ; } elseif ( $ pid ) { /* close the parent */ return false ; } // make ourselves the session leader if ( posix_setsid ( ) == - 1 ) { throw new \ RuntimeException ( 'Failed to become a daemon.' ) ; } return true ; }
Split into a new process. Returns true when it's the child process and false
for the parent process.

@return bool
Split into a new process . Returns true when it s the child process and false for the parent process .