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

Request #18372 Support for multiple PEAR directories
Submitted: 2011-03-18 14:46 UTC
From: ondrej Assigned:
Status: Bogus Package: PEAR (version SVN)
PHP Version: 5.3.6 OS: Any
Roadmaps: (Not assigned)    
Subscription  


 [2011-03-18 14:46 UTC] ondrej (Ond?ej Surý)
Description: ------------ Hi, this is a request to add something like PEARPATH support for whole PEAR. The reasoning for this is same as with all other languages (perl, python) - PEAR files coming from packages will go to /usr/share/php (or other /usr/share dir) and custom packages will go to /usr/local/share/php. The locally installed packages should probably have higher priority then distribution files (it would be probably quite hard to pick 'most recent' version, so just predictable behavior would be fine). Test script: --------------- The current status is a quite a mess (f.e. on Debian system): 1. 'apt-get install php-pear' will install PEAR files into /usr/share/php 2. 'pear upgrade' will overwrite files in /usr/share/php 3. security update for php5 comes out and running 'apt-get upgrade' will overwrite PEAR files in /usr/share/php to the version bundled with php5 version (not even deleting the files from upgrade) You end up with a directory with mixed files from different PEAR packages versions. Expected result: ---------------- Not a messy directory :) Actual result: -------------- Messy directory.

Comments

 [2011-03-18 20:19 UTC] cweiske (Christian Weiske)
-Status: Open +Status: Bogus
You can configure the directories by using $ pear config-show $ pear config-set php_dir /usr/share/php/
 [2011-03-18 20:24 UTC] dufuz (Helgi Þormar Þorbjörnsson)
My suggestion, don't mix 2 package management systems together. If you are wanting to distribute PEAR packages via apt-get but also allow people to install things via the pear installer then you are bound to have "messy" happen. There is no clean way past that - Only saving grace is if apt-get installation of a pear package would be funnelled through the pear installation instead of apt-get but I think that probably might not be possible.
 [2011-03-18 22:01 UTC] ondrej (Ond?ej Surý)
BTW it's not my request, but the users' one...see: http://bugs.debian.org/cgi- bin/bugreport.cgi?bug=443524 > There is no clean way past that Here we don't agree. At least python (setuptools install modules into /usr/local/lib/pythonX.Y/dist-packages/, perl (CPAN installs custom modules into /usr/local/share/perl/X.Y/) and ruby (custom gems go to /var/lib/gems) can cope with that quite gracefully by supporting multiple load paths. > You can configure the directories Sure, you can, but that you loose the tracking of what is installed under /usr/share/php/ Could you please give it more thought? I think the result would be beneficial not only for Debian (and it's users), but for all other distributions out there.
 [2011-03-19 02:04 UTC] dufuz (Helgi Þormar Þorbjörnsson)
Christina did demonstrate how to make PEAR install into a different directory when run via the "pear" command while apt-get installs into the normal path, then PHP has to keep both in the include path but you have the danger of installing the same package in both locations and thus causing a priority "conflict" e.g. a PHP include path of .:/usr/loca/share/php:/usr/share/php means that any pear code installed via "pear" is included first and then apt-get installation is used. I see no other way of how this would work otherwise; PEAR nor PHP does not include a specific way of automagically load classes, there are autoloaders and include_paths but they are fairly dependent on one another and as such the priority matters. Perhaps you can elaborate on the idea further before we think about including any extra complexity.
 [2012-01-02 16:44 UTC] butch (Florian Roscher)
Hello! Disclaimer: I am describing Perl out of my head. To be 100% sure about the details I would have to (re)read the documentation. But with regard to this feature request it seems sufficient to me. What Perl/CPAN does is supporting two layers: Vendor: This is where the Vendor installs its Perl modules into. In case of a Debian system the vendor is Debian and the base path is /usr/lib/perl5. Site: This is where the local system administrator installs Perl modules into using the CPAN. Perl considers both paths when looking for modules to load. Up to here this seems possible via: - configuring pear to install into i.e. /usr/local/share/pear and - make PHP include from /usr/share/php:/usr/local/share/pear The difference and the problem/missing feature with pear as far as I understand is: When installing a new PEAR package into /usr/local/share/pear it would resolve and install all dependencies within /usr/local/share/pear, correct? This way it ignores the packages already present in /usr/share/php, installed via package management of the Linux distribution in use, i.e. Debian. When I do install a new Perl package via CPAN it looks for its dependencies within both paths, vendor and site, thus making it possible to install only one missing package at 'site level' using 'vendor level' to satisfy its dependencies. I like and do use this setup to get both: - security support for all packages included within the linux distribution - the possibility to install missing packages easily. Is my comment comprehensible? Do you find it helpful resp. like the idea? Regards Florian