Esempio n. 1
0
 /**
  * Check if the given host belongs to this service, by checking its hostname against this
  * service's hostnamePattern. Returns the instance number from the hostname on success else returns false.
  *
  * @param Host $host
  *
  * @return bool|int
  */
 public function isThisYourHost(Host $host)
 {
     $matches = [];
     if (preg_match($this->hostnamePattern, $host->getHostname(), $matches)) {
         return (int) $matches[1];
     }
     return false;
 }