Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PEAR - Still Relevant?

Tags:

php

pear

I'm an advanced beginner trying to choose a PHP repository or framework that I can turn to as a reliable source of reusable code.

I really like the idea of PEAR, but am scared off by the lack of good/current documentation.

For example, most of the articles on PEAR are dated, there are no well-reviewed books available, and the official manual is extremely uninviting.

I've considered PHP frameworks (CakePHP, CodeIgniter, Symfony, Zend) and CMS frameworks (Drupal, Joomla, WordPress), but as a long-term solution, I want reusable code that isn't going to add any unnecessary overhead.

In other words, I want code that was written for a single purpose that I can plug into my application where it's needed without "borrowing" any more code than what the application requires -- just like if I had written it myself from scratch.

So I ask -- is PEAR a good long-term choice for reusable PHP code?

like image 931
Mike S. Avatar asked Feb 01 '11 01:02

Mike S.


People also ask

Is Pear deprecated?

Unlike other reports, the pear/pecl tools are not deprecated in PHP. They're merely not being enabled by default. The pecl tool is the only official way to fetch and compile PHP extensions.

What is Pear in PHP Quora?

PEAR is a framework and repository for reusable PHP components. PEAR stands for PHP Extension and Application Repository. It contains all types of PHP code snippets and libraries. It also provides a command line interface to install "packages" automatically.


3 Answers

The level of documentation is up to the PEAR package in question; some are poor, but others are not. You can get an idea of the status of a package by looking at its page, checking out release dates, ticket activity etc.

Some very useful tools, e.g. phpunit and PHP CodeSniffer, use PEAR as their main distribution channel, and it would be hard to argue that these are no longer relevant.

I think that PEAR as a whole is definitely still relevant, and will continue to be so, but many individual packages are probably not.

Using a framework in no way prevents you from using PEAR packages as well; most frameworks (barring, perhaps, Zend which seems to be an everything-and-the-kitchen-sink-as-well type framework) don't include everything anyway, so there will still be a lot of things you'll want to do that aren't already covered.

Update 2013

It looks like composer has gained more traction these days, it's probably worth looking into as well.

like image 143
El Yobo Avatar answered Nov 02 '22 23:11

El Yobo


You're comparing things which are not related. Pear is a PHP extension library - a simple collection of classes. CakePHP, Zend, etc, are frameworks that ship some logical functionality, nicely documented and well tested. They aim to "enforce" best practises for web development (MVC, for instance) and provide means to do that.

I'm an advanced beginner

I am not sure what that is :)

is PEAR a good long-term choice for reusable PHP code?

To be honest, in my 5 years of PHP addiction, I have rarely had a need to go the PEAR way. Right now, I can recommend looking at Zend Framework and Doctrine 2. They are both backed by good active community.

like image 37
iBiryukov Avatar answered Nov 03 '22 00:11

iBiryukov


I'd say PEAR is a good resource for small snippets and specialized libraries. I prefer PEAR over any third party site or random forums for this purpose, since the code on there usually at least used to be maintained for a few versions and has a certain minimum level of quality. Even if a package is outdated, you can get a rough estimate of how mature the code is by looking at its history.

Frameworks or DALs are IMO out of scope of PEAR, so it's hardly comparable.

I rarely use PEAR, but if I can find a useful package on there I prefer it over any other source. I would say that PEAR didn't quite live up to what it was supposed to be though. It has not reached the status of Ruby gems or Python eggs, which is a bit of a shame.

like image 35
deceze Avatar answered Nov 02 '22 23:11

deceze