FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16243&edit=1

ID: 16243
Updated by: daniel.oconnor@gmail.com
Reported By: hoareau dot olivier at gmail dot com
Summary: Provide http_proxy config variable for each channel
Status: Open
Type: Feature/Change Request
Package: PEAR
Operating System: Windows
Package Version: 1.8.1
PHP Version: 5.2.5
Roadmap Versions:
New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2009-05-20 16:39:12] ohoareau

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

------------------------------------------------------------------------

Search Discussions

  • Hoareau Olivier at May 21, 2009 at 2:30 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=16243&edit=1

    ID: 16243
    Comment by: hoareau.olivier@gmail.com
    Reported By: hoareau dot olivier at gmail dot com
    Summary: Provide http_proxy config variable for each channel
    Status: Open
    Type: Feature/Change Request
    Package: PEAR
    Operating System: Windows
    Package Version: 1.8.1
    PHP Version: 5.2.5
    Roadmap Versions:
    New Comment:

    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


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-05-21 15:24:28] doconnor

    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-20 16:39:12] ohoareau

    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

    ------------------------------------------------------------------------
  • Carsten_sttgt at May 23, 2009 at 12:33 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=16243&edit=1

    ID: 16243
    Comment by: carsten_sttgt@gmx.de
    Reported By: hoareau dot olivier at gmail dot com
    Summary: Provide http_proxy config variable for each channel
    Status: Open
    Type: Feature/Change Request
    Package: PEAR
    Operating System: Windows
    Package Version: 1.8.1
    PHP Version: 5.2.5
    Roadmap Versions:
    New Comment:

    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


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-05-21 16:29:58] ohoareau

    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-21 15:24:28] doconnor

    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-20 16:39:12] ohoareau

    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

    ------------------------------------------------------------------------
  • Carsten_sttgt at May 23, 2009 at 12:50 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=16243&edit=1

    ID: 16243
    Comment by: carsten_sttgt@gmx.de
    Reported By: hoareau dot olivier at gmail dot com
    Summary: Provide http_proxy config variable for each channel
    Status: Open
    Type: Feature/Change Request
    Package: PEAR
    Operating System: Windows
    Package Version: 1.8.1
    PHP Version: 5.2.5
    Roadmap Versions:
    New Comment:
    # 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?


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-05-23 14:32:08] cwiedmann

    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-21 16:29:58] ohoareau

    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-21 15:24:28] doconnor

    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-20 16:39:12] ohoareau

    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

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 21, '09 at 1:25p
activeMay 23, '09 at 12:50p
posts4
users2
websitepear.php.net

2 users in discussion

Carsten_sttgt: 3 posts Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase