Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Request #16243 Provide http_proxy config variable for each channel
Submitted: 2009-05-20 20:39 UTC
From: ohoareau Assigned:
Status: Open Package: PEAR (version 1.8.1)
PHP Version: 5.2.5 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2009-05-20 20:39 UTC] ohoareau (Olivier Hoareau)
Description: ------------ When using PEAR installer inside a company lan you often need to use a proxy to download third party channels. Indeed, when using your own PEAR channel on your local lan, you need to use proxy for third party packages (on internet, or for pear.php.net packages for example) BUT no proxy for your local packages. Indeed if one of your local package depends on a third party package (example : your create a "desktop installation package" that depends on all popular php tools package available on internet) when you use the command : $ pear install mychannel/mypackage the PEAR installer will need to access directly the mychannel channel BUT to use a proxy to pick up the packages and channel.xml (REST files) on the dependencies channels. Currently, it is possible to define channel-based configuration variable using config-set BUT http_proxy configuration variable is not activated in this list of channel-based variable because at least PEAR/Command/Channels.php, PEAR/Command/Remote.php, PEAR/Downloader.php and PEAR/REST.php are not compliant with multiple proxies (channel-based proxies). I request to have a channel-based http_proxy configuration variable as a new feature. Test script: --------------- In PEAR 1.8.1 distribution, I made following patches : *** PEAR/Command/Channels.php - Line 243 : $loc = $downloader->downloadHttp($channel, $this->ui, $tmpdir,null,null,false,$chan); - Line 545 : $this->ui, $tmpdir, null, $lastmodified,false,$params[0]); - Line 553 : $this->ui, $tmpdir, null, $lastmodified,false,$params[0]); - Line 593 : $this->ui, $tmpdir, null, $lastmodified,false,$params[0]); *** PEAR/Command/Remote.php - Line 177 : '/channel.xml', $chan->lastModified(),null,null,null,false,$channel); *** PEAR/Downloader.php - Line 1585 : if ($config->get('http_proxy',null,$channel) && - Line 1586 : $proxy = parse_url($config->get('http_proxy',null,$channel))) { *** PEAR/REST.php - Line 315 : if ($this->config->get('http_proxy',null,$channel)&& - Line 316 : $proxy = parse_url($this->config->get('http_proxy',null,$channel)) I am not sure this is a complete and bug-free patch but it works fine for me Expected result: ---------------- Channel-based http_proxy configuration variable Actual result: -------------- Using proxy defined in http_proxy configuration variable for all channels and packages

Comments

 [2009-05-21 19:24 UTC] doconnor (Daniel O'Connor)
Like the idea, can see the value - but I don't suppose you'd like to take a look at either pyrus (http://wiki.pear.php.net/index.php/Pyrus_-_Getting_Started) or doing a patch against cvs pear-core? ie cvs diff -u
 [2009-05-21 20:29 UTC] ohoareau (Olivier Hoareau)
If you can do it by yourself in less than 5 minutes, it is better, if not, I would provide you with the diff -u next week (don't have time this week) For me Pyrus is not an option for the moment, because PHP 5.3 is required (as written in the Wiki) and many many many clients, in fact ALL my clients are using php 5.1.x or 5.2.x I was not aware of the Pyrus project and I am really pleased to know that a port (or more than that ;) ) of PEAR is getting done in PHP 5 style ;) I will probably have several professional use cases for packaging / dependencies / deployments, so if you need use cases do not hesitate to ask ;) So you can do it and add it in the next PEAR release ? How long does it take for such a feature request to be available using a : $ pear update pear command ? In fact, I am in a hurry to use this patch, so I patched my developers workstations but when the feature will be available I will do an update ;) Best regards, Olivier Hoareau
 [2009-05-23 18:32 UTC] cwiedmann (Carsten Wiedmann)
Hello, is this not more a bug then a feature request? Example: # pear channel-discover pear.phpunit.de # pear -c pear.phpunit.de config-set http_proxy localhost # pear config-get http_proxy --> empty # pear -c pear.phpunit.de config-get http_proxy --> localhost # pear install pear.phpunit.de/PHPUnit Is fetching the package without the configured proxy for this channel? It's also curious, that a: # pear config-show always shows: | CONFIGURATION (CHANNEL PEAR.PHP.NET): ^^^^^^^^^^^ even if i use: # pear -c pear.phpunit.de config-show BTW: If http_proxy is a global setting, there must be an error if i try to set this for a channel. Instead of having this setting individual for each channel, it may be also possible, to add a global config var like "http_no_proxy". Similar to the proxy settings in a webbrowser. Regards, Carsten
 [2009-05-23 18:49 UTC] cwiedmann (Carsten Wiedmann)
> # pear -c pear.phpunit.de config-set http_proxy localhost Just seen this. PEAR is creating the config file for this channel (filename "pear.phpunit.de") in my current directory. How can PEAR read this file during it's operation with this channel? And of course. I'm using the pear command whenever I need it. So at the end I have a lot of config files all over my harddisk?