示例#1
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);
         }
     }
 }