EricMakesStuff\ServerMonitor\Notifications\Notifier::httpPingDown PHP Метод

httpPingDown() публичный Метод

public httpPingDown ( HttpPingMonitor $httpPingMonitor )
$httpPingMonitor EricMakesStuff\ServerMonitor\Monitors\HttpPingMonitor
    public function httpPingDown(HttpPingMonitor $httpPingMonitor)
    {
        $additionalInfo = '';
        if ($httpPingMonitor->getCheckPhrase() && !$httpPingMonitor->getResponseContainsPhrase()) {
            $additionalInfo = " Response did not contain \"{$httpPingMonitor->getCheckPhrase()}\"";
        }
        $this->sendNotification('whenHttpPingDown', "HTTP Ping Failed: {$httpPingMonitor->getUrl()}!", "HTTP Ping Failed for {$httpPingMonitor->getUrl()}! Response Code {$httpPingMonitor->getResponseCode()}.{$additionalInfo}", BaseSender::TYPE_ERROR);
    }

Usage Example

 /**
  * @param \EricMakesStuff\ServerMonitor\Events\HttpPingDown $event
  */
 public function whenHttpPingDown(HttpPingDown $event)
 {
     $this->notifier->httpPingDown($event->httpPingMonitor);
 }