30 Useful PHP Classes and Components
Simplicity and extensibility are the main reasons why PHP became the favourite dynamic language of the Web. 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.
Below I present 30 useful PHP classes and components that you can use to test, develop, debug and deploy your PHP applications. Let me know if I missed anything or if you have something to add.
Database
Creole is a database abstraction layer for PHP5. It abstracts PHP’s native db-specific API to create more portable code while also providing developers with a clean fully object-oriented interface based loosely on the API for Java’s JDBC. Creole was originally created as a sub-project of Propel to meet specific needs that none of the available abstraction layers were able to address in any satisfactory way.
LINQ is a component that adds native data querying capabilities to PHP using a syntax reminiscent of SQL. It defines a set of query operators that can be used to query, project and filter data in arrays, enumerable classes, XML, relational database, and third party data sources.
ADOdb Database Abstraction Library for PHP. It supports MySQL, PostgreSQL, Interbase/Firebird, Informix, Sybase SQL Anywhere, Oracle, MS SQL 7 and 2000, SAP DB, Sybase, DB2, FrontBase, Foxpro, Access, Netezza, LDAP, ODBTP, ADO, and generic ODBC. It also features portable database creation, database-backed session support (with encryption), SQL performance monitoring and database health checks.
Propel is an Object-Relational Mapping (ORM) framework for PHP5. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data.
Doctrine is a tool for object-relational mapping in PHP. It sits on top of PDO and is itself divided into two main layers, The DBAL and the ORM. The Doctrine ORM is mainly build around the ActiveRecord, Data Mapper and Metadata Mapping patterns.
PHPillow is an object orientated wrapper for CouchDB.
Development
phpDocumentor is the current standard auto-documentation tool for the php language. Similar to Javadoc, and written in php, phpDocumentor can be used from the command line or a web interface to create professional documentation from php source code. phpDocumentor has support for linking between documentation, incorporating user level documents like tutorials and creation of highlighted source code with cross referencing to php general documentation.
HTML Purifier is a standards-compliant HTML filter library written in PHP. HTML Purifier will not only remove all malicious code (better known as XSS) with a thoroughly audited, secure yet permissive whitelist, it will also make sure your documents are standards compliant, something only achievable with a comprehensive knowledge of W3C’s specifications.
PHP CodeSniffer is a PHP5 script that tokenises and “sniffs” PHP code to detect violations of a defined set of coding standards. It is an essential development tool that ensures that your code remains clean and consistent. It can even help prevent some common semantic errors made by developers.
GeSHi is a generic syntax highlighter for PHP that takes any source code and highlights it in XHTML and CSS. It features case-sensitive or insensitive highlighting, auto-caps/non-caps of any keyword, an unlimited scope for styling, the use of CSS in which almost any aspect of the source can be highlighted, the use of CSS classes to massively reduce the amount of output code, function-to-URL capabilities, line numbering, and much more.
Unit Testing
To make code testing viable, good tool support is needed. This is where PHPUnit comes into play. It is a member of the xUnit family of testing frameworks and provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.
Unit testing, mock objects and web testing framework for PHP built around test cases. If you know JUnit/JMock or some of the PHPUnit clones this will need no explanation. Includes a native web browser for testing web sites directly.
PHPSpec allows you to write executable examples reflecting specifications of the desired behaviour of the source code being described. You can write code examples which are repeatable, this means you write an example and may repeat it as often as you wish to ensure the implementation code it relates to continues to abide by the example.
Debugging
During both the development and deployment phases, developers require a consistent stream of diagnostic information in order to determine whether the application is working as intended. The functionality of the PHP Debug component can be used to write debug messages and measure the execution time.
dBug is the PHP version of ColdFusion’s cfdump. It outputs coloured and structured tabular variable information and has the ability to force certain types of output.
Deployment
Phing it’s a project build system based on Apache Ant. You can do anything with it that you could do with a traditional build system like GNU make, and its use of simple XML build files and extensible PHP task classes make it an easy-to-use and highly flexible build framework.
Xinc is a continuous integration server written in PHP 5. It has built-in support for Subversion and Phing (and therefore PHPUnit), and can be easily extended to work with alternative version control or build tools.
Security
Securimage is an open-source free PHP CAPTCHA library for generating complex images and CAPTCHA codes to protect forms from spam and abuse. It can be easily added into existing forms on your website to provide protection from spam bots. It can run on most any web server as long as you have PHP installed, and GD support within PHP.
Scavenger is an open source real-time vulnerability management tool. It helps you respond to vulnerability findings, track vulnerability findings, review accepted or false-positive answered vulnerabilities, and not ‘nag’ you with old vulnerabilities.
PHP Security Scanner is a tool written in PHP intended to search PHP code for vulnerabilities. MySQL DB stores patterns to search for as well as the results from the search. The tool can scan any directory on the file system.
PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application. The IDS neither strips, sanitizes nor filters any malicious input, it simply recognizes when an attacker tries to break your site and reacts in exactly the way you want it to.
User Authentication
phpGACL is an set of functions that allows you to apply access control to arbitrary objects (web pages, databases, etc) by other arbitrary objects (users, remote hosts, etc). It offers fine-grained access control with simple management, and is very fast.
XML and PHP
SimplePie is a very fast and easy-to-use class, written in PHP, that puts the “simple” back into “really simple syndication”. Flexible enough to suit beginners and veterans alike, SimplePie is focused on speed, ease of use, compatibility and standards compliance.
This package can be used to generate feeds in either RSS 1.0, RSS 2.0 or Atom formats.
Image Handling
WideImage is an object-oriented library for image manipulation, written in PHP 5. It’s a pure-PHP library and doesn’t require any external libraries apart from the GD2 extension.
Graphs and Charts
pChart is a PHP class oriented framework designed to create aliased charts. Most of todays chart libraries have a cost, our project is intended to be free. Data can be retrieved from SQL queries, CSV files, or manually provided. Focus has been put on rendering quality introducing an aliasing algorithm to draw eye candy graphics.
JpGraph can be used to create numerous types of graphs either on-line or written to a file. JpGraph makes it easy to draw both “quick and dirty” graphs with a minimum of code as well as complex graphs which requires a very fine grained control. The library assigns context sensitive default values for most of the parameters which minimizes the learning curve.
The Google Chart API returns a PNG-format image in response to a URL. Several types of image can be generated: line, bar, and pie charts for example. For each image type you can specify attributes such as size, colors, and labels.
PHP/SWF Charts is a simple, yet powerful PHP tool to create attractive web charts and graphs from dynamic data. Use PHP scripts to generate or gather the data from databases, then pass it to this tool to generate Flash (swf) charts and graphs.
This is an object oriented library for live-manipulating Open Flash Chart.
Template Engines
Savant is a powerful but lightweight object-oriented template system for PHP. Unlike other template systems, Savant by default does not compile your templates into PHP; instead, it uses PHP itself as its template language so you don’t need to learn a new markup system. Savant has an object-oriented system of template plugins and output filters so you can add to its behaviour quickly and easily.
Smarty is a template engine for PHP. More specifically, it facilitates a manageable way to separate application logic and content from its presentation. One of the unique aspects about Smarty is the template compiling. This means Smarty reads the template files and creates PHP scripts from them. Once they are created, they are executed from then on. Therefore there is no costly template file parsing for each request.
PHPTAL is a templating engine for PHP5 that implements brilliant Zope Page Templates syntax. PHPTAL is fast thanks to compiled templates and fine-grained caching. Makes it easy to generate well-formed XML/XHTML.
Documents
TCPDF is a PHP class for generating PDF documents without requiring external extensions. TCPDF supports all ISO page formats and custom page formats, custom margins and units of measure, UTF-8 Unicode, RTL languages, some HTML code, barcodes, TrueTypeUnicode, TrueType, Type1 and encoding, JPEG, GIF and PNG images, graphic functions, bookmarks, JavaScript, forms, page compression, and encryption.
Create Excel documents in PHP. This component provides a set of classes for the PHP programming language, which allow you to write to Excel 2007 files and read from Excel 2007 files. This project is built around Microsoft’s OpenXML standard and PHP.
Nice one, ty m8 :)
Alin-T
May 30, 2008 at 5:41 am
Great list!
I suggest you add xdebug (http://xdebug.org/) and APC (http://no2.php.net/apc). Both are excellent tools to have.
Eirik Hoem
May 30, 2008 at 7:51 am
Hey, great list. I especially like the chart libraries as I have a couple of clients who will be needing this functionality shortly :D
Thanks!
Adam
Adam Charnock
May 30, 2008 at 8:13 am
And where is PHPMailer in E-mail category?
Michał Mech
May 30, 2008 at 8:59 am
I’d recommend using Swift Mailer, it’s a PHP5 object-oriented component, and compared with PHPMailer it has more features, it’s more secure and the interface is more intuitive.
phpimpact
May 30, 2008 at 9:27 am
This is an excellent list! It’s been a while since I’ve used PHP but after reading this I’m thinking of all sorts of new things I can do with it. Thanks!
Anthony
May 30, 2008 at 9:43 am
[...] Impact collected nice collection of useful PHP classes and components for your PHP applications. In this post you would find tools [...]
30 Useful PHP Classes and Components | PHP Readings
May 30, 2008 at 10:48 am
In addition to Scavenger, there’s an app called nessquik that I wrote that is a frontend for Nessus. It’s different from Scavenger in several ways. Check it out.
Tim
May 30, 2008 at 1:34 pm
[...] 30 Useful PHP Classes and Components [...]
Katod’un Seyir Defteri - 30.05.2008 at katodivaihe
May 30, 2008 at 1:36 pm
Awesome list! Found a few that I am going to start using.
Jimmy
May 30, 2008 at 3:08 pm
You might want to check out Mimesis, which allows you to use flat files for your database instead of an actual database.
Luke
May 30, 2008 at 3:24 pm
Excellent list. Found some new components that I will start using.
Thanks!
Lalit
May 30, 2008 at 4:01 pm
CodeIgniter is missing here, which is a must. Frameworks should have their own title…
Cem Gencer
May 30, 2008 at 4:55 pm
Great list. Thanks – I just found out about TCPDF.
Binny V A
May 30, 2008 at 5:31 pm
exelente muchas gracias !!!
ctraos
May 30, 2008 at 6:47 pm
Great list. Regardless of what some people say, I still like PHP. Thanks for putting this together.
Hamish M
May 30, 2008 at 8:16 pm
Thanks a lot for this list of great classes and components for PHP 5 :)
Hugo
May 30, 2008 at 9:15 pm
[...]Weekend Links – MooVirtualPano, Syntax Highlighting, Image Crop, PHP Classes, Revision3 Attack[...]
Weekend Links
May 31, 2008 at 2:54 am
[...] PHPImpact has posted 30 useful PHP classes here. [...]
Programming Tips and Tricks
May 31, 2008 at 6:20 am
[...]30 Useful PHP Classes and Components « PHP::Impact ( [str blog] )[...]
xocal.net
May 31, 2008 at 7:30 am
[...] Cargnelutti of PHP::Impact ( [str blog] ) just wrote a post listing 30 useful PHP classes and components. I won’t be using all 30 of them of course, but a couple of them look pretty promising and [...]
30 Useful PHP Classes and Components » BoltPress
May 31, 2008 at 3:19 pm
[...] 30 Useful PHP Classes and Components (tags: php programming language webdesign classes components) [...]
Chris Carlson
May 31, 2008 at 11:33 pm
[...] 30-useful-php-classes-and-components/ [...]
PHP-Engineering's Blog
June 1, 2008 at 3:26 pm
[...] 30 Useful PHP Classes and Components « PHP::Impact ( [str blog] ) [...]
iKeif
June 1, 2008 at 5:31 pm
[...] has compiled a list of 30 useful PHP classes and components ranging from development, testing & debug to deployment & [...]
84 Bytes
June 1, 2008 at 9:18 pm
[...] 30 Useful PHP Classes and Components – good listing of useful classes, components, and tools written in PHP, for PHP projects. [...]
GrantPalin.com
June 2, 2008 at 2:18 am
[...] I present 30 useful PHP classes and components that you can use to [...]
tooling components
June 2, 2008 at 2:24 am
[...] Click here to view 30 useful php classes and components. [...]
Ben Maynard
June 2, 2008 at 5:18 am
[...] o clases para ahorrarnos tiempo y trabajo a la hora de desarrollar nuestras aplicaciones. Esta lista de 30 componentes y clases desarrolladas en PHP y para PHP nos pueden ser muy [...]
aNieto2K
June 2, 2008 at 6:42 am
[...] post de Anieto2k donde nos muestra esta lista de componentes o clases en php. Y es que estos scripts nos ayudaran a ahorrar tiempo y mareos cuando creemos nuestras [...]
Pboza
June 2, 2008 at 7:40 am
[...] post @ phpimpact [...]
Mohamed Jama
June 2, 2008 at 8:28 am
Nice list. I suggest you to add the php user class (phpuserclass.com), a great class for user manipulation.
Nick
June 2, 2008 at 12:00 pm
[...] 30 Useful PHP Classes and Components (tags: php) [...]
Skylog » Blog Archive » links for 2008-06-03
June 3, 2008 at 6:31 am
[...] 30 clases y componentes recopilada por PHP Impact [...]
30 clases y componentes
June 3, 2008 at 2:54 pm
[...] o clases para ahorrarnos tiempo y trabajo a la hora de desarrollar nuestras aplicaciones. Esta lista de 30 componentes y clases desarrolladas en PHP y para PHP nos pueden ser muy [...]
Ricotero's Blog
June 4, 2008 at 2:59 am
No mention of Artishow ? Good way to produce Graphic, plot table …
Good list any way ! I’ve got a lot of things to discover !
Kéké.
keke
June 4, 2008 at 7:26 am
[...] vous êtes en rade de classes PHP en voilà 30 super pratiques [...]
damdec
June 5, 2008 at 8:38 pm
[...] el tiempo que el programador usa para crear sus aplicaciones. Algunas de ellas las econtrareis en Php Impact – 30 useful php classes and components y realmente son [...]
DarkRasseL Weblog
June 6, 2008 at 10:13 am
Hmm, Nice helpful post. Thanks
Jahedur Rahman
June 10, 2008 at 5:39 am
[...] 30 Useful PHP Classes and Components – An awesome list of classes that will better your PHP applications [...]
Rawkes Weekly
June 29, 2008 at 12:49 pm
[...] Pienso que debía tenerla aquí, más vale tarde que nunca. Así que, aquí os dejo la lista de 30 componentes de php útiles de verdad para aquellos que no piensan en re-inventar la [...]
TheDaVis Blog — 30 componentes PHP muy útiles
July 26, 2008 at 11:48 am
[...] 30 Useful PHP Classes and Components (tags: resources PHP Opensource Development web2.0 webdev) [...]
Kiwihaus
August 3, 2008 at 1:42 pm
[...] PHPimpact(**) [...]
Heartshare
September 1, 2008 at 2:30 pm
Thanks for quoting PHP_Debug. See you. COil :)
COil
September 1, 2008 at 8:08 pm
Nice one, thanks for the list… there’s a few I could use right now.
Drew
October 13, 2008 at 9:50 am
[...] 30 componentes y clases PHP muy útiles. Vía anieto2k. [...]
30 recursos de PHP muy útiles » blogpocket 7.0
October 13, 2008 at 1:08 pm
Great great list. I have now already downloaded two of the packages you listed. I really wanted a pdf library that didn’t have to be compiled in. I’ll try my hand at that first.
rick
October 14, 2008 at 3:13 pm
Thanks for mentioning my project :-) (shame I only made last place in the charts — boo!! haha :-)
Geishi is really good, a little slow but soooo easy to use.
monk.e.boy
monk.e.boy
October 14, 2008 at 3:55 pm
[...] Source: PHP Impact; Date: 2008 / 29 [...]
30 Useful PHP Classes and Components [PHP Impact]
October 14, 2008 at 11:34 pm
It’s a great library, thanks for making it open source!
Federico
October 15, 2008 at 12:05 am
[...] 30 Useful PHP Classes and Components. [...]
SkyMinds.Net
November 4, 2008 at 7:37 am
You did a great job by gathering so many useful things on one page! Some of the tools are new for me, some of them I’ve already been using
Lionel
November 27, 2008 at 4:55 pm
[...] 30 Useful PHP Classes and Components [...]
Top Posts 2008
January 10, 2009 at 2:29 pm
Hey. Nice list. I would like to come back here and look around again.
Sudheer
January 11, 2009 at 10:32 am
[...] http://phpimpact.wordpress.com/2008/05/29/30-useful-php-classes-and-components/ Еще о некоторых полезных классах [...]
meekman’s spot » Blog Archive » 50 Extremely Useful PHP Tools
January 21, 2009 at 9:17 pm
[...] 30 Useful PHP Classes and Components Tags: clases, PHP, Recursos [...]
30 clases útiles para PHP « websenior
February 10, 2009 at 7:44 pm
Another ecellent template class is “TinyButStrong”
http://www.tinybutstrong.com/
Frank M.
February 27, 2009 at 10:47 am
Thanks for the tips. Definitely some great stuff here!
Dan
March 2, 2009 at 2:05 am
[...] http://blog.fedecarg.com/2008/05/29/30-useful-php-classes-and-components/ [...]
Web 404
March 5, 2009 at 9:34 am
thanksss a++ very god Classes and Components
davetiye
May 19, 2009 at 2:03 pm
Hey try Buzz PHP. Its a free LGPL component system with a true object orient design.
Derek Evans
July 15, 2009 at 5:57 am
Nice list, thanks!
Jef
August 5, 2009 at 2:34 pm
[...] Below I present 30 useful PHP classes and components that you can use to test, develop, debug and deploy your PHP applications. Let me know if I missed anything or if you have something to add. More … [...]
Narendra Dhami
August 10, 2009 at 11:04 am
You might be interested to know that we’ve just release a new bridge for PHP developers to .NET through REST: PHP Toolkit for ADO.NET Data Services http://blogs.msdn.com/interoperability/archive/2009/08/21/a-new-bridge-for-php-developers-to-net-through-rest-php-toolkit-for-ado-net-data-services.aspx
Feel free to ping me if you’re interested.
JC
JC Cimetiere
August 21, 2009 at 5:01 pm
Great stuff, thanks Jean.
Federico
August 21, 2009 at 8:53 pm
> And where is PHPMailer in E-mail category?
Forget about PHPMailer – there are better options on the table :p
Les
September 22, 2009 at 4:17 pm
I think there is a problem with the link of php security scanner (maybe has moved due to Germany’s new law scheme). Is the following correct?
http://sourceforge.net/projects/securityscanner/
dimitris mistriotis
November 18, 2009 at 11:33 am
Fixed, thanks!
Federico
November 18, 2009 at 1:07 pm