public function daemonize() {

        // fork script
        $pid = $this->fork();

        // detach from current terminal (if any)
        $this->detach();

        // update pid reference (we have a new daemon)
        $this->pid = $pid;

        // start process daemon
        $this->start();

    }
public function daemonize() {

        // fork script
        $pid = $this->fork();

        // detach from current terminal (if any)
        $this->detach();

        // update pid reference (we have a new daemon)
        $this->pid = $pid;

        // start process daemon
        $this->start();

    }
public function daemonize ( ) { // fork script $ pid = $ this -> fork ( ) ; // detach from current terminal (if any) $ this -> detach ( ) ; // update pid reference (we have a new daemon) $ this -> pid = $ pid ; // start process daemon $ this -> start ( ) ; }
Start as a daemon, forking main process and detaching it from terminal
Start as a daemon forking main process and detaching it from terminal