注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

天高云淡的博客

A bad beginning makes a bad ending.

 
 
 

日志

 
 

How to install all PEAR modules at once  

2009-12-29 15:16:33|  分类: ajax + pear |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
Question 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! Sad

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:

Arrow 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. Wink

Arrow 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.
  评论这张
 
阅读(586)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017