chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6262 Location: Outer Space
|
Posted: Sun Sep 05, 2004 11:40 pm Post subject: How to install all PEAR modules at once |
|
|
|
Problem: You want to install, if not all, then at least almost all PEAR modules in your local PHP system. Maybe you are a developer and need them all. Maybe you are traveling around a lot and you are offline each and every time you need a specific PEAR module, so you would like to grab them all at once. Maybe you want to see how they are programmed and learn from them. Or maybe you just hate having to install a new PEAR module every so often.
There are many reasons why you would like to download and install the whole PEAR library - but there is no way to do this officially!
I have searched the Web and, unless I am becoming progressively blind, I have not been able to find any single tar.gz or zip package that would allow a one-click installation of the whole PEAR module library.
Maybe there are reasons behind such a decision of the PEAR developers. Maybe they wanted to save bandwidth. Or maybe they did not want to load your system with modules you might never need.
Or maybe they wanted to make you hate PHP just as you hate Perl for its eternal and never-ending module installations - installations you just hate to make at a time you are interested in only one thing and nothing else: run that f....fine script of yours!
Happily, if you are working under Linux, the force is with you:
Solution:I am assuming that you are running PHP > 4.3.0, so that you already have the PEAR Package Manager installed on your system. To download all PEAR packages at once, you have first to get a list of them:
| Code: |
pear remote-list | awk '{print $1}' > pear-list
|
Edit the pear-list file manually - most probably you will only need to delete the first 2 lines of header text, that's all!
Now type
| Code: |
cat pear-list | xargs -n 1 pear install
|
Some packages may fail to be installed, in this case just rerun the above once more:
| Code: |
cat pear-list | xargs -n 1 pear install
|
You may not manage to get them all installed (this depends on the versions of your installed components), but you will at least have 99% of them - and that's enough for the start.
Note: Would you like to be able to type such magic incantations yourself? Are you impressed by the power of the command-line? Have a look in the GNU/Linux command-line tools summary. _________________ Regards
Chris Karakas
www.karakas-online.de |
|