PHP5-OOP Articles, Blogs, Books and Frameworks

liunx

Guest
Hey all,

I am asking folks to post links to good resources about developing PHP5 applications with OOP pricinciples and design patterns.

Here are some questions to jump start the thread:

Are there any tutorials on creating a simple CRUD application with PHP5 and OOP?
Do any Dependency Injection/Inversion of Control frameworks exists for PHP5?
What are some good OOP controller frameworks for PHP5 that are OOP?
Are there any Object Relational Mapping (ORM) frameworks for PHP5?

What I am specifically seeking to do is build OOP apps with PHP5 that use the Model-View-Controller methodology. If anyone could help get to started in that direction I would greatly appreciate it.

-AaronSo far I have found an MVC controller framework on my own (since I'm not getting any love on this thread) called CakePHP. Any resources such as blog posts, articles and tutorials about CakePHP would be great!

One down, two to go.

Any takers on a Dependency Injection/Inversion of Control framework for PHP that I can use with CakePHP? How about an Object Relational Mapping (ORM) framework (it kind of looks like an ORM might be baked into CakePHP tho')?There are quite a few of all the things you mention above. Perhaps too many you might think. Just a selection:

MVC Frameworks
Zend framework
Cake PHP
Symfony

Object relational mappers
Doctrine
eZ Persistent Object (ez Components)
Propel

Dependency Injection
Pico Container (can't think of any others actually)

There's also a whole bunch of stuff in the PEAR repository, but often those libraries have strong dependencies on each other and so are hard to use alone.

With so many products floating around, none have really taken hold as the de facto standard. I think this leads firstly to alot of misinformation and secondly to a tendency to 'roll your own'.

My favourite resource for things OO is the Sitepoint PHP Application Design forum. It's alot less active than PHPBuilder but there are some very smart PHP guys posting on there.Shrike,

Thanks for the reply. I have gone through over half of the CakePHP manual and have followed the blog tutorial and am really enjoying the framework. It is much like the Rails framework for Ruby and the ColdBox framework for ColdFusion.

I am looking into the Pico Container DI framework but there does not seem to be many resources about it and all of the documentation is for Java (because the PHP version is a port of the Java version). I also found two other DI frameworks: Phemto and Garden. I can't find much about them eighter tho'.

It looks like CakePHP has ORM support built-in. If I'm wrong, I'm definitely going to check into the ones you mentioned.

I went ahead and created an account on the SitePoint forums and posted a thread regarding DI Frameworks for PHP5.

Thanks for the tips,
AaronPerhaps move your post to the PHP Application Design forum (a subforum of the main PHP forum). It might get some more deserved attention there.I found the articles on devshed (<!-- m --><a class="postlink" href="http://www.devshed.com/c/b/PHP/">http://www.devshed.com/c/b/PHP/</a><!-- m -->) particularly helpful when starting with php5. The articles by Alejandro Gervasio (<!-- m --><a class="postlink" href="http://www.devshed.com/cp/bio/Alejandro-Gervasio/">http://www.devshed.com/cp/bio/Alejandro-Gervasio/</a><!-- m -->) really helped me to get my head round the various design patterns.

I dunno about an ORM framework but I do know of a PHP Object Generator (<!-- m --><a class="postlink" href="http://www.phpobjectgenerator.com/">http://www.phpobjectgenerator.com/</a><!-- m -->) that is worth a look. This is working in reverse of course: define the table structure and it will generate a CRUD object for you, and the sql create table code if you wish. Well worth a look.I would just exercise plenty of caution in using POG.

It's a good idea, for sure, but when I generated the code - it had "SQL injection attack" written all over it.
 
Back
Top