What is your favorite open source PHP application and why?

This is intentionally a little bit of a vague question, but I’m curious what people come up with.

One thing I’ve noticed from reading a few PHP books is that they are all pretty decent at teaching you the semantics and core of the language itself. However, knowing PHP itself doesn’t make you a good developer. Even books about software design and design patterns can only help so much. I think one of the best ways to improve your software design skills is to study well designed programs.

I’ve recently been reading a book called PHP5 CMS that walks you through the core components of a not so widely known CMS system called Aliro. One of my sticking points right now is trying to move more towards Object Oriented design and away from procedural code. Right now I use a ton of classes in my code, but of course just using classes in your code doesn’t really make it an object oriented program.

Anyway, I’m curious if anyone else has any good recommendations on well designed open source PHP applications?

If you’re making a journey towards software nirvana via OOP you will quickly come across the concept of Frameworks, and of course the MVC paradigm.

I would guess that a high percentage (50%?) of modern, OOP-based PHP programmes are constructed atop of a Framework.

Analysing the structure of some of those Frameworks, the design decisions made, their interpretation of each of the layers of MVC might help you.

Those design decisions though are based on the authors’ own understanding and interpretation of:

-basic OOP principles
-design patterns
-the special nature of web-based applications (as opposed to desktop)

All roads seem to eventually end up leaning heavily on advice from Java-centric texts from the likes of The GOF (Gang of Four) and Martin Fowler - although there are now thankfully many PHP-centric books available too.

I find it hard to see how you “learn” about principles such as “Favour Composition over inheritance” or when/how/why “promote loose coupling” between your classes just by poring over someone else’s code (unless they put all that information in their comments).

I think you need to do a bit of both, reading some texts and studying some PHP Frameworks.

YII, ZF, Cake, Symfony etc

http://www.mediawiki.org/wiki/MediaWiki

Umm. Sure why not.

Does PHP itself count?

I enjoy using the following OS packages when coding:

Swift for sending emails
Dwoo for templating
GeSHi for syntax highlighting
jQuery for ease-of-use JavaScript

Of course, I also love PHP and MySQL, Apache etc. Oh, and Ubuntu, which I’ve been using for about 6 months now.

And lastly, I love my own CMS (see sig) :smiley:

I agree to an extent. However, when I look at source code I don’t attempt to just read through it. I look more at the big picture. First I start with the database schema, then the file organization, and then class structure.

I may read every line of a couple particular components. For instance I may read through the session handling and user management code and see how it compares to code I’ve written myself to see if maybe their is a smarter way of organizing the code. Plus by understanding the style of 1 or 2 components it gives you a little bit better of an idea how the rest of the code is probably organized.

Sometimes it just too daunting of a task though. Especially since many open source programs are written by dozens if not hundreds of programmers over several years, so I try to look at small or medium sized projects.

Well, there’s a difference between well-designed and favorite. Asking me my favorite, I’d say PHP for obvious reasons (since I don’t use many others).

As for well-designed? There aren’t many out there. I personally ascribe to The Daily WTF truism that “All software sucks, it’s just that some of it sucks less than others”, but that’s kind of off the topic.

That said, unless your learning style is pretty dissimilar from most people, I wouldn’t expect to learn a whole lot simply by reading source code. Most source does a terrible job of (a) being interesting and (b) really teaching you something.