Federico Cargnelutti

Simple is better than complex. Complex is better than complicated. | @fedecarg

30 Useful PHP Classes and Components

with 74 comments

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

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 for PHP

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

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

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

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

PHPillow is an object orientated wrapper for CouchDB.

Development

phpDocumentor

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

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

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

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

PHPUnit

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.

SimpleTest

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

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

PHP Debug

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

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

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

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

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

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

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

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

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

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.

PHP Universal Feed Generator

This package can be used to generate feeds in either RSS 1.0, RSS 2.0 or Atom formats.

Image Handling

WideImage

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

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

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.

PHP Google Charts API

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

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.

Open Flash Chart

This is an object oriented library for live-manipulating Open Flash Chart.

Template Engines

Savant

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

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

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

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.

PHP Excel

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.

About these ads

Written by Federico

May 29, 2008 at 10:39 pm

Posted in PHP, Programming, Tools

74 Responses

Subscribe to comments with RSS.

  1. Nice one, ty m8 :)

    Alin-T

    May 30, 2008 at 5:41 am

  2. 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

  3. 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

  4. And where is PHPMailer in E-mail category?

    Michał Mech

    May 30, 2008 at 8:59 am

  5. 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

  6. [...] Impact collected nice collection of useful PHP classes and components for your PHP applications. In this post you would find tools [...]

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

  8. [...] 30 Useful PHP Classes and Components [...]

  9. Awesome list! Found a few that I am going to start using.

    Jimmy

    May 30, 2008 at 3:08 pm

  10. 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

  11. Excellent list. Found some new components that I will start using.
    Thanks!

    Lalit

    May 30, 2008 at 4:01 pm

  12. CodeIgniter is missing here, which is a must. Frameworks should have their own title…

    Cem Gencer

    May 30, 2008 at 4:55 pm

  13. Great list. Thanks – I just found out about TCPDF.

    Binny V A

    May 30, 2008 at 5:31 pm

  14. exelente muchas gracias !!!

    ctraos

    May 30, 2008 at 6:47 pm

  15. 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

  16. Thanks a lot for this list of great classes and components for PHP 5 :)

    Hugo

    May 30, 2008 at 9:15 pm

  17. [...]Weekend Links – MooVirtualPano, Syntax Highlighting, Image Crop, PHP Classes, Revision3 Attack[...]

    Weekend Links

    May 31, 2008 at 2:54 am

  18. [...] PHPImpact has posted 30 useful PHP classes here. [...]

  19. [...]30 Useful PHP Classes and Components « PHP::Impact ( [str blog] )[...]

    xocal.net

    May 31, 2008 at 7:30 am

  20. [...] 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 [...]

  21. [...] 30 Useful PHP Classes and Components (tags: php programming language webdesign classes components) [...]

    Chris Carlson

    May 31, 2008 at 11:33 pm

  22. [...] 30-useful-php-classes-and-components/ [...]

  23. [...] 30 Useful PHP Classes and Components « PHP::Impact ( [str blog] ) [...]

    iKeif

    June 1, 2008 at 5:31 pm

  24. [...] 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

  25. [...] 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

  26. [...] I present 30 useful PHP classes and components that you can use to [...]

    tooling components

    June 2, 2008 at 2:24 am

  27. [...] Click here to view 30 useful php classes and components. [...]

    Ben Maynard

    June 2, 2008 at 5:18 am

  28. [...] 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

  29. [...] 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

  30. [...] post @ phpimpact [...]

    Mohamed Jama

    June 2, 2008 at 8:28 am

  31. 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

  32. [...] 30 Useful PHP Classes and Components (tags: php) [...]

  33. [...] 30 clases y componentes recopilada por PHP Impact [...]

  34. [...] 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

  35. 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

  36. [...] vous êtes en rade de classes PHP en voilà 30 super pratiques [...]

    damdec

    June 5, 2008 at 8:38 pm

  37. [...] 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

  38. Hmm, Nice helpful post. Thanks

    Jahedur Rahman

    June 10, 2008 at 5:39 am

  39. [...] 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

  40. [...] 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 [...]

  41. [...] 30 Useful PHP Classes and Components (tags: resources PHP Opensource Development web2.0 webdev) [...]

    Kiwihaus

    August 3, 2008 at 1:42 pm

  42. [...] PHPimpact(**) [...]

    Heartshare

    September 1, 2008 at 2:30 pm

  43. Thanks for quoting PHP_Debug. See you. COil :)

    COil

    September 1, 2008 at 8:08 pm

  44. Nice one, thanks for the list… there’s a few I could use right now.

    Drew

    October 13, 2008 at 9:50 am

  45. [...] 30 componentes y clases PHP muy útiles. Vía anieto2k. [...]

  46. 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

  47. 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

  48. [...] Source: PHP Impact; Date: 2008 / 29 [...]

  49. It’s a great library, thanks for making it open source!

    Federico

    October 15, 2008 at 12:05 am

  50. [...] 30 Useful PHP Classes and Components. [...]

    SkyMinds.Net

    November 4, 2008 at 7:37 am

  51. 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

  52. [...] 30 Useful PHP Classes and Components [...]

    Top Posts 2008

    January 10, 2009 at 2:29 pm

  53. Hey. Nice list. I would like to come back here and look around again.

    Sudheer

    January 11, 2009 at 10:32 am

  54. [...] 30 Useful PHP Classes and Components Tags: clases, PHP, Recursos [...]

  55. Another ecellent template class is “TinyButStrong”
    http://www.tinybutstrong.com/

    Frank M.

    February 27, 2009 at 10:47 am

  56. Thanks for the tips. Definitely some great stuff here!

    Dan

    March 2, 2009 at 2:05 am

  57. thanksss a++ very god Classes and Components

    davetiye

    May 19, 2009 at 2:03 pm

  58. 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

  59. Nice list, thanks!

    Jef

    August 5, 2009 at 2:34 pm

  60. [...] 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

  61. 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

  62. Great stuff, thanks Jean.

    Federico

    August 21, 2009 at 8:53 pm

  63. > 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

  64. 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

  65. Fixed, thanks!

    Federico

    November 18, 2009 at 1:07 pm

  66. As I’m currently stuck dealing with this; what, in your opinion, are the better solutions to PHPMailer?

    Rebecca Rushing

    February 19, 2010 at 4:01 am

  67. Federico

    February 19, 2010 at 9:20 am

  68. Good collection of PHP components. I quite like the open flash chart

    Web design

    April 15, 2010 at 6:02 pm

  69. Nice collection. and html2ps is one for html to pdf conversion.

    Praveen Bamandla

    May 28, 2010 at 12:17 pm

  70. Nice collection. These are very useful for me Thanks for sharing.

    Davetiye

    April 24, 2011 at 5:03 am

  71. Thanks a lot, Great collection!!!

    Anthony Howe

    October 3, 2011 at 2:17 am

  72. Nice information, thank you

    Mostafa Talebi - Maya

    December 21, 2012 at 10:46 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 531 other followers