protected function isServerRunningForAddress($address)
    {
        $pidFile = $this->getPidFile($address);
        $serverInfo = $this->getServerInfo();
        if (file_exists($pidFile)) {
            $pid = file_get_contents($pidFile);
        } elseif (isset($serverInfo[$address])) {
            $pid = $serverInfo[$address]['pid'];
        }

        if (!empty($pid) && !$this->isProcessDead($pid)) {
            return $pid;
        } elseif (!empty($pid)) {
            // The PID is no longer valid. Delete the lock file and
            // continue.
            $this->stopServer($address);
        }

        list($hostname, $port) = explode(':', $address);

        return PortUtil::isPortInUse($port, $hostname);
    }
protected function isServerRunningForAddress($address)
    {
        $pidFile = $this->getPidFile($address);
        $serverInfo = $this->getServerInfo();
        if (file_exists($pidFile)) {
            $pid = file_get_contents($pidFile);
        } elseif (isset($serverInfo[$address])) {
            $pid = $serverInfo[$address]['pid'];
        }

        if (!empty($pid) && !$this->isProcessDead($pid)) {
            return $pid;
        } elseif (!empty($pid)) {
            // The PID is no longer valid. Delete the lock file and
            // continue.
            $this->stopServer($address);
        }

        list($hostname, $port) = explode(':', $address);

        return PortUtil::isPortInUse($port, $hostname);
    }
protected function isServerRunningForAddress ( $ address ) { $ pidFile = $ this -> getPidFile ( $ address ) ; $ serverInfo = $ this -> getServerInfo ( ) ; if ( file_exists ( $ pidFile ) ) { $ pid = file_get_contents ( $ pidFile ) ; } elseif ( isset ( $ serverInfo [ $ address ] ) ) { $ pid = $ serverInfo [ $ address ] [ 'pid' ] ; } if ( ! empty ( $ pid ) && ! $ this -> isProcessDead ( $ pid ) ) { return $ pid ; } elseif ( ! empty ( $ pid ) ) { // The PID is no longer valid. Delete the lock file and // continue. $ this -> stopServer ( $ address ) ; } list ( $ hostname , $ port ) = explode ( ':' , $ address ) ; return PortUtil :: isPortInUse ( $ port , $ hostname ) ; }
Check whether another server is running at an address.

@param string $address

@return bool|int
Check whether another server is running at an address .