Example #1
0
 /**
  * Checks whether the server is up and running (accepting connections).
  * Will return true/false based on the server status.
  *
  * @return bool Returns true if server is running, false if not.
  * @access public
  */
 public function isUp()
 {
     $addr = $this->config->getAddress();
     $port = $this->config->getPort();
     $sock = @fsockopen($addr, $port, $errno, $errstr, (int) Flux::config('ServerStatusTimeout'));
     if (is_resource($sock)) {
         fclose($sock);
         return true;
     } else {
         return false;
     }
 }