コード例 #1
0
 public function match(UriInterface $uri)
 {
     /*
      * if the URI does not contain the seed, it is not allowed
      */
     return false === stripos($uri->toString(), $this->seed->toString());
 }
コード例 #2
0
 public function match(UriInterface $uri)
 {
     foreach ($this->regexes as $regex) {
         if (preg_match($regex, $uri->toString())) {
             return FALSE;
         }
     }
     return TRUE;
 }
コード例 #3
0
 public function match(UriInterface $uri)
 {
     $currentHostname = $uri->getHost();
     if ($this->allowSubDomains) {
         // only use hostname.tld for comparison
         $currentHostname = join('.', array_slice(explode('.', $currentHostname), -2));
     }
     return !in_array($currentHostname, $this->allowedHosts);
 }
コード例 #4
0
 public function match(UriInterface $uri)
 {
     return null !== $uri->getQuery();
 }
コード例 #5
0
 public function match(UriInterface $uri)
 {
     return null !== $uri->getFragment();
 }
コード例 #6
0
ファイル: UriDecorator.php プロジェクト: aktuba/php-spider
 /**
  * @return string|null
  */
 public function getFragment()
 {
     return $this->decorated->getFragment();
 }
コード例 #7
0
 /**
  * @param UriInterface $uri
  * @return Resource
  */
 public function request(UriInterface $uri)
 {
     $response = $this->getClient()->createRequest(RequestInterface::GET, $uri->toString())->send();
     return new Resource($uri, $response);
 }
コード例 #8
0
 /**
  * @return bool
  */
 public function match(UriInterface $uri)
 {
     return !in_array($uri->getScheme(), $this->allowedSchemes);
 }