views:

570

answers:

17

What are some of your can't-live-without php libraries?

Any kind, collections, templates, anything that makes your life easier when working with php.

+6  A: 

Smarty! It's a great templating engine, and makes PHP much nicer to work with in my opinion.

Alex Fort
+11  A: 

Zend framework is a great collection of components ready to use in any project

Tomasz Tybulewicz
+7  A: 

PHPUnit is another great library. A decent alternative to Zend Framework if you don't like how it works is eZ Components.

Personally I would be wary of using smarty. We've been using it here in our shop for a few years on an enterprise app and it suffers from a lot of limitations and performance issues. Remember Smarty can't do everything PHP can, and what it does it doesn't do very well IMhO.

zodeus
Considering Smarty will compile into php on the first page load, what performance issues have you had?
rick
+5  A: 

CodeIgniter - It is free, compact, simple and easy to understand http://codeigniter.com

Art Spasky
+3  A: 

Doctrine as ORM/DBAL

Doctrine is an object relational mapper (ORM) for PHP 5.2.3+ that sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.

Karsten
+3  A: 

phpUnit for testing

In the last decade, PHP has developed from a niche language for adding dynamic functionality to small websites to a powerful tool making strong inroads into large-scale Web systems. Critical business logic like this needs to work correctly. But how do you ensure that it does? You test it, of course.

Karsten
+2  A: 

HTML_BBCodeParser (pear!)

This is a parser to replace UBB style tags with their html equivalents.

Karsten
But is "typical user" aware of BBCode? I think it's better to add some RichEdit control and sanitize it's output
Tomasz Tybulewicz
+2  A: 

TemplateLite

Mostly compatible with Smarty but crazy fast.

Mark Biek
+4  A: 

FirePHP (ajax debugging)

FirePHP enables you to log to your Firebug Console using a simple PHP method call.

All data is sent via response headers and will not interfere with the content on your page.

FirePHP is ideally suited for AJAX development where clean JSON and XML responses are required.

Karsten
This is awesome!
Mark Biek
+4  A: 

SimpleTest

Nice, simple, light-weight unit test framework.

Mark Biek
+3  A: 

PHPMAILER for sending emails

I use this library frequently for sending email messages from PHP.

PragyaRatna
very good library, indeed.
dusoft
+4  A: 

HTMLPurifier for security

dusoft
+3  A: 
Luis Melgratti
+1  A: 
Jon Winstanley
+2  A: 

phpQuery for accessing and manipulating the DOM using the same sort of selectors as jQuery. Very handy for screen-scraping-type scripts.

Chad Birch
+1  A: 

PaginateIt

http://www.bradyvercher.com/php-pagination-class.html

Paginate it is a cool little class which takes a large set of results and paginates it up and provides the links for the user to navigate to the other pages.

From their web site:

PaginateIt is a simple PHP class I wrote to make pagination easy. Pagination allows you to break up a collection of data (gallery, news items, etc...) into different pages. It can work in conjuction with a database, flat files, or any other collection.

I had written code over and over again to paginate data on various websites before I finally decided I needed a better way to do this. This class will allow you to easily implement pagination and help keep your code cleaner.

Jon Winstanley
A: 

Var dump (not the function, the PEAR plug in). Very useful var_dump wrapper for debugging, can output a variable in a number of useful ways.

Brian