$uri =
clone $uri;
} elseif (is_string($uri)) { $uri = Zend_Uri::
factory($uri);
} if (!
$uri instanceof Zend_Uri_Http
) { /** @see Zend_Http_Client_Exception */
throw new Zend_Http_Client_Exception('Passed parameter is not a valid HTTP URI.'
);
} // Set auth if username and password has been specified in the uri
if ($uri->
getUsername() &&
$uri->
getPassword()) { $this->
setAuth($uri->
getUsername(),
$uri->
getPassword());
} // We have no ports, set the defaults
if (!
$uri->
getPort()) { $uri->
setPort(($uri->
getScheme() == 'https' ? 443 : 80
));
} $this->uri =
$uri;
return $this;
}