Ejemplo n.º 1
0
 protected function toRefererUrl(Zend_Uri $uri)
 {
     if ($uri->getPort() == '80') {
         return $uri->getScheme() . '://' . $uri->getHost() . $uri->getPath() . $uri->getQuery();
     }
     return (string) $uri;
 }
Ejemplo n.º 2
0
 /**
  * Sets the URI of the remote site.  Setting a new URI will automatically
  * clear the response properties.
  *
  * @param string|Zend_Uri $uri
  * @return void
  */
 public final function setUri($uri)
 {
     // Accept a Zend_Uri object or decompose a URI string into a Zend_Uri.
     if ($uri instanceof Zend_Uri) {
         $this->_uri = $uri;
     } else {
         // $uri string will be validated automatically by Zend_Uri.
         $this->_uri = Zend_Uri::factory($uri);
     }
     // Explicitly set the port if it's not already.
     if (!$this->_uri->getPort() && $this->_uri->getScheme() == 'https') {
         $this->_uri->setPort(443);
     } else {
         if (!$this->_uri->getPort()) {
             $this->_uri->setPort(80);
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * ignore port and fragment
  * for match siteinfo(wedata)'s url-regex
  *
  */
 private function toUrl(Zend_Uri $uri)
 {
     $port = $uri->getPort();
     $port = ($port > 0 and $port != '80') ? ':' . $port : '';
     return $uri->getScheme() . '://' . $uri->getHost() . $port . $uri->getPath() . $uri->getQuery();
 }