An Interview with the creator of the Akelos Framework

I already covered the Akelos PHP framework in the past, but for those who don’t know it, Akelos seems to be one of the few Rails-inspired PHP frameworks still worth mentioning, besides CakePHP and Symphony of course.

I recently has a look at their recently-relaunched community website and I noticed this phrase:

“Being port of Ruby on Rails to PHP Akelos is also optimized for programmer happiness and sustainable productivity”

Bermi Ferrer, Akelos creator, openly admits the framework is a port of Ruby on Rails to PHP, an attempt to help “Ruby on Rails developers who need to code in PHP, among others. Of course Akelos is not Rails, simply because Ruby is (thank God for that!) not PHP, however I decided to find out more, and I asked Bermi a few questions, which he promptly answered.

There are a lot of frameworks for PHP, perhaps too many: why did you decide to create Akelos rather than using one of the existing ones?

I started coding Akelos back in 2004 for our internal developments. At that time I only found very few frameworks out there like Mojavi and eZ Publish. These frameworks were not my ideal of an Agile development environment, so I decided to brew my own solution.

After reading Patterns of Enterprise Application Architecture it was clear to me the kind of framework I wanted Akelos to become, so I started to implement some of the design patterns from the book into Akelos.

During the summer of 2005 I had a look into other PHP frameworks like CakePHP, PHP on Trax, and Biscuit but none of them was more complete or easier to use than what Akelos was already at that time.

Then I used Rails for one small personal project and immediately found that Akelos interfaces, conventions and philosophy were close to the Rails approach. Rails ActiveRecord implementation was impressive, better than mine and much much better than other existing PHP implementations, so I first ported the ActiveRecord code using PHP AdoDB as the database abstraction layer.

After that point, whenever I had a problem to solve while coding my customers applications I turned to Rails and they usually had the most elegant solution available. So I did like the idea of digging into Rails code to learn more Ruby and bringing Rails magic to the PHP world. It also helped the fact that Rails inline documentation is excellent so it could be easily adapted for Akelos.

What’s new since last time I posted about Akelos?

The biggest change is the direction that the project has taken. Until now we have not dedicated time to promote Akelos, we just used it for our internal projects and we have been adding features as needed without a fixed roadmap or advocacy.

Now this has changed. More and more developers are using Akelos and contributing functionalities they miss from Rails. After some serious contribution proposals and many developers telling us how much they like Akelos, we decided to take the time to build a nice community site which includes forums, a wiki, a new tutorial and a screen-cast.

There are also some improvements like:

  • Sintags, now accepts ruby-like calls to helper methods from the views.
  • Action Webservice, a component for creating and consuming Web Services easily.
  • Action Mailer, which allows you to receive and send (directly or in delayed mode) emails from within your application. (this is almost ready to ship)
  • Acts as tree behavior for Models.
  • Many performance improvements.
  • Many small contributions and bug fixes.
  • Code base reduced from 16MB to 9MB.

From the new site, it seems that Akelos is – or aims to be – a port of Rails for PHP. Is that true? Do you aim to target Rails developers as possible users of the framework in situations in which “they have no choice” but to use PHP instead of Ruby?

Akelos has ported many Ruby on Rails components keeping their interfaces and functionality whenever it was feasible to port the Ruby code to PHP. It might be considered a port in the sense of functionality, but there are some Rails strengths that rely on the Ruby language and that are impossible to port to PHP. However, Ruby developers will find that Akelos is the PHP framework with is the closest to Rails.

On the other hand, many PHP developers have moved to Ruby because PHP lacked a hyper-productive and fun-to-use framework like Rails for building complex applications. That is no longer the case, and those who excel at PHP can start being productive from day one by using Akelos. In this way, Akelos target users are those who already know PHP and need to build complex applications that can run on almost any cheap shared hosting using a solid foundation based on good coding practices and widely accepted conventions.

What Rails features are missing in Akelos?

A standalone webserver like WebBrick, RJS, has and belongs to many through associations, string/number/date extensions and Active Resource.

Ruby-powered features like modules, runtime class overriding and blocks will never be available in Akelos.

Scaffolds in Akelos work by generating code, I found quite useless to enable $scaffold = true; and have magic functionality that you can’t modify, so I decided not to invest my time on that one.

I noticed quite a few generators available for Akelos, do they work as a Rails developer may expect them to work?

The ones that are available do pretty much the same as in RoR.

How does Akelos compare to other similar PHP frameworks like, say, CakePHP? What features does Akelos offer which Cake doesn’t offer and vice-versa?

I’m not aware of Cake’s functionalities. At the time I started porting Rails my feelings about CakePHP were that they missed the simplicity point in favor of architectural discussions that lead to confusing code, but that was long ago.

Akelos (and Rails) do not implement ACL like Cake does, as that is a business logic component that varies too much from one case to other, it has no place inside the framework.

Akelos is built with internationalization in its core. You can even internationalize your Models by prefixing the column name with the locale.

I think that Cake only has an act_as_tree behavior on models while Akelos has Tree, Nested Set, and List. Akelos also implements handy features from Rails like optimistic locking, lazy loading, table inheritance, counters, automatic transactions, really powerful validations, calculations…, and I think most of these advanced features are still missing on Cake, but maybe I’m wrong.

Did you include unit tests for all the framework classes?

The main components are fully unit tested, and no new code or patch gets into the trunk without unit tests.

Did you or someone do any performance test or benchmarks on Akelos already?

During the last month a lot of code was refactored to improve performance with the help of Xdebug, Kcachegrind and ab. We significantly improved the performance in one of our most complex intranet applications, a basecamp-like system.

Akelos also implements caching at many levels, so it’s very easy to increase performance as we did with a new CMS that can handle +200 requests per second using Apache in a cheap shared server environment.

Why should a PHP developer choose Akelos over another PHP framework?

Akelos MVC implementation and workflow are really easy to understand.

In Akelos all the methods and interfaces are thoroughly selected, so whenever you need to do something you just need to type what you think. Default options are selected with care so you don’t need to set any configuration unless you want to modify the default behavior.

Coding multilingual applications, building complex relationships within models, distributing databases changes within your development team, building Ajax interfaces, unit testing your code and many other common tasks for PHP developers are really simple to accomplish when using Akelos.

Akelos is designed to work on PHP4 and PHP5 and it comes with an easy web installer you can adapt for your application. It has functions for working with files and directories in common situations when the web server runs as a different user.

And one of the main reasons for choosing Akelos is that it makes coding fun and lets you focus on solving user problems rather than wasting your time in repetitive technical annoyances. When coding with other developers the convention over configuration philosophy helps everybody to understand exactly how everything works and where to find things.

Is there any website using Akelos already?

The Chemical Brothers new website which has been developed by 3rd Eye Vision (3ev) is using Akelos.

The site is running a CMS named Editam which we will release as Open Source in a near future.

Some small websites like Fundacio Caixa Carlet and many intranet/extranet sites that we’ve been coding during the last 2 years.

What are your future plans for Akelos? Anything new on the way?

A new manual, and a better API interface are the main priorities right now.

Continuing bringing Rails functionality as needed.

Releasing our sister project Editam CMS which will help developers who need to add functionality on the top of a CMS using a solid MVC framework like Akelos.