Skip to content

Instantly share code, notes, and snippets.

@sasezaki
Created March 28, 2009 07:35
Show Gist options
  • Save sasezaki/87053 to your computer and use it in GitHub Desktop.
Save sasezaki/87053 to your computer and use it in GitHub Desktop.
<?php
$pear_conf = new PEAR_Config;
$clientConfig = array();
// check proxy
if ($http_proxy = $pear_conf->get('http_proxy')) {
$uri = Zend_Uri_Http::fromString($http_proxy);
if ($uri->getUsername()) $config['proxy_username'] = $uri->getUsername();
if ($uri->getHost()) $config['proxy_host'] = $uri->getHost();
if ($uri->getPort()) $config['proxy_port'] = $uri->getPort();
$clientConfig = array_merge(array('adapter'=>'Zend_Http_Client_Adapter_Proxy'), $config);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment