Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is PEAR "heavy"?

Tags:

php

pear

I've recently been working with PHPUnit which requires PEAR. Every PHP developer I mention PEAR to seems to think it's a big lumbering mess of code. What's the truth? To me, PEAR seems like any other library, it's not going to slow down your code unless you decide to include and use a lot of functionality.

While I have no reason to use PEAR in a production environment, I would be interested to know what the general consensus opinion is of it in case I ever have a situation where I may consider using it for a production project.

like image 726
Endophage Avatar asked Feb 11 '11 18:02

Endophage


2 Answers

Pear is not "heavy" depending on what you're doing. Some pear libraries may be over-engineered, but as a whole, it's not bad at all.

Use it for when you need a library or two without an entire framework. But if you need a consistent and large-scale set of libraries, I'd suggest using a framework such as Zend (whether or not you use the architecture) for the libraries.

<personal_opinion>

The only problem I've faced with it is that up until very recently, they supported PHP4. That means that all of the code they produced couldn't take advantage of any of the newer PHP5 OOP elements. Now that has changed, but many of the libraries haven't been updated. So it's really a mix of some really nice utilities and some really eih ones. Look before you blindly choose is my opinion...

So, looking at it as a whole, it can be seen as a big lumbering mess (as you put it) due to the fair number of old and abandoned projects. But some parts of it are actively maintained and are of very high quality (especially the core). It's meant to be pieced out depending on your needs, not used as a framework, so to me this isn't a huge deal...

</personal_opinion>

like image 161
ircmaxell Avatar answered Oct 10 '22 18:10

ircmaxell


I have had no problems with using PEAR packages in production environments - and I certainly would not consider PEAR 'heavy'. You are able to deploy one, or any number of PEAR packages as you see fit, whereas with Zend for example you must install the whole set of components or none at all.

This really depends on your definition of 'heavy' though; doesn't it?

like image 31
kguest Avatar answered Oct 10 '22 16:10

kguest