views:

109

answers:

5

I do not mind which pattern is used. I am just looking for something that is:

1) Lightweight

2) Under active development

3) Well documented

4) Supports MySQL

Can anyone recommend anything?

+1  A: 

Not sure it qualifies as "lightweight", at least considering the number of source-files (that's not what makes something either slow or fast ;-) ), but if you are looking for a PHP ORM that is :

  • Under active development
  • Quite well documented
  • Support MySQL
  • Has support
  • Is one of the two most used PHP ORM
    • Which is probably one of the most import things...

Then, I would suggest you take a look at Doctrine.

Pascal MARTIN
+1 Doctrine is a pleasure to work with, the jQuery of ORM.
Christopher Altman
Likely the best one atm, but definitely not lightweight.
Gordon
A: 

Its either Doctrine or Propel, Doctrine currently has the upper hand in my opinion (Doctrine)

b8b8j
+1  A: 

There is also http://www.phpactiverecord.org/

Gordon
A: 

If you only want an ORM you can take the one in the http://micromvc.com framework - it is only 1 file and supports all four model relation types. (belongs_to, has_one, has_many, and has_many_through).

It does tie into the PDO database wrapper a tiny bit so you might have to edit the __construct() function.

The other option is TweetMVC which has a 1KB ORM. All-in-all, it's certainly the smallest.

No other libraries compare to the speed and size of these two.

Xeoncross
A 1KB ORM without a database abstraction layer is practically useless for real-life applications
stillstanding
Both of those projects offer a database abstraction layer that you can use with it.
Xeoncross
A: 

Axon ORM has a database abstraction layer that requires no stupid xml/yaml configuration files. And there's no need to rebuild anything if you change your schema. Plus the fact that it truly is lightweight and has the ability to work with most major database engines: SQLite, MySQL, PostgreSQL, MSSQL, Sybase, etc. It's less than 15Kbytes.

stillstanding