src/AbstractDaemon.php
public function start()
    {
        $this->ensureNotLocked();
        $pid = $this->fork();

        // return pid
        if ($pid > 0)
            return $pid;

        declare(ticks=1);

        $this->lock();
        $this->registerSignalHandlers();
        if ($this->strategy === self::NORMAL)
            $this->onStart();
        else
            $this->startTicking();
        $this->unlock();
        exit(0);
    }
public function start()
    {
        $this->ensureNotLocked();
        $pid = $this->fork();

        // return pid
        if ($pid > 0)
            return $pid;

        declare(ticks=1);

        $this->lock();
        $this->registerSignalHandlers();
        if ($this->strategy === self::NORMAL)
            $this->onStart();
        else
            $this->startTicking();
        $this->unlock();
        exit(0);
    }
Starts daemon.
@return integer Process ID of daemon.