src/AbstractDaemon.php
public function getStatus()
    {
        if (!$this->useLockFile)
            return false;

        $lock_file = strtr($this->lockFile, [
            '{tmp}' => sys_get_temp_dir(),
            '{name}' => $this->name,
        ]);

        if (!file_exists($lock_file))
            return false;

        if (!is_readable($lock_file))
            throw new Exception('Lock file can not be read ('.$lock_file.'). Is daemon launched by root?');

        $lock_data = json_decode(file_get_contents($lock_file));

        // corrupted lock data, delete lock
        if (!is_object($lock_data)) {
            if (!unlink($lock_file))
                throw new Exception('Can not delete messed lock file ('.$lock_file.').');
            return false;
        }

        // check if daemon is still running
        if (!is_dir('/proc/'.$lock_data->pid)) {
            if (!unlink($lock_file))
                throw new Exception('Can not delete invalid lock file ('.$lock_file.').');
            return false;
        }

        return $lock_data;
    }
public function getStatus()
    {
        if (!$this->useLockFile)
            return false;

        $lock_file = strtr($this->lockFile, [
            '{tmp}' => sys_get_temp_dir(),
            '{name}' => $this->name,
        ]);

        if (!file_exists($lock_file))
            return false;

        if (!is_readable($lock_file))
            throw new Exception('Lock file can not be read ('.$lock_file.'). Is daemon launched by root?');

        $lock_data = json_decode(file_get_contents($lock_file));

        // corrupted lock data, delete lock
        if (!is_object($lock_data)) {
            if (!unlink($lock_file))
                throw new Exception('Can not delete messed lock file ('.$lock_file.').');
            return false;
        }

        // check if daemon is still running
        if (!is_dir('/proc/'.$lock_data->pid)) {
            if (!unlink($lock_file))
                throw new Exception('Can not delete invalid lock file ('.$lock_file.').');
            return false;
        }

        return $lock_data;
    }
Returns status about a daemon.
Notice: if lock files are not used, this method alwats returns false.
@return boolean|array Returns false if daemon is not running