Posted by h3rald
Thu, 19 Jul 2007 11:02:00 GMT
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.
Read more...
Posted in Blog | Tags CakePHP, Frameworks, PHP, Rails | no comments | no trackbacks
Posted by Fabio Cevasco
Wed, 02 Aug 2006 07:33:00 GMT
Bermi Ferrer kept his promise, and even if a few were skeptic on the pre-announced features of his upcoming Akelos framework, last week he sent me a “development preview” and a few days ago he opened the development SVN repository to the public:
svn://akelos.org/trunk
Go, get it: it’s worthwhile (see below).
“[…] The Akelos Framework is an open-source port of Ruby on Rails to the PHP programming language.
The main goal of the Akelos Framework is to help programmers to build multilingual database-backed web applications according to the Model-View-Control pattern. It lets you write less code by favoring conventions over configuration.”
At the Akelos Framework Features page you can find detailed information about what has been already implemented into the framework.
I think it says it all, well almost. Some people will undoubtedly be disgusted by yet-another-hopeless-Rails-clone: not again! I hear them crying…
Well, yeah, I think this – to be honest – should be the last attempt someone makes to port Rails to PHP or at least port some features and the overall philosophy, like CakePHP did: there are honestly too many for one single language. Look at Python, Django seems to be the only “Rails-inspired” framework available and everyone is happy with it, while as a general rule PHP folks are never happy with what they already got.
Bermi is undoubtedly one of them, and that’s the reason he decided to code his very own Rails-inspired framework for PHP, which is, to date, the most remarkable of the ones I left out (it wasn’t available at the time) in my article.
Confirmed Features & Contents
So well, although I didn’t really have a proper chance to play with Akelos I can certainly herald some of its – verified, this time – features.
For one, it’s huge. Take Cake, add every excellent, useful third party library or class you can possibly thing of and you’ll get Akelos. No kidding. The unzipped source of the whole framework is a massive 16MB, 8.5 of which constitute the vendors folder. What’s in it? Well, all this:
- ADOdb
- Domit
- FPDF
- Excel (reader library)
- Hyper Estraier full-text search system
- Inutio XML-RPC Library
- Many PEAR packages
- PHPCodeAnalyzer
- PHPmailer
- SimpleTest
- A Simple PHP YAML Class
- Textile
Then, similarly, all the state-of-the-art Javascript/AJAX hyper-hyped libraries are included:
- AFLAX
- Behaviour
- Builder
- various Scriptaculous packages
- Prototype
- FileUploader (by the author, using prototype)
- Window
- EventSelectors

Good, well, kind of: that’s just what others did, but it’s worth noting that it’s all there and – apparently – integrated with the framework, hopefully not too tightly. But people are fussy, and do not get excited easily anymore, long gone are the early days of Rails, when the whole Internet shake at hearing about code generators… Aye, there are in Akelos as well, of course!
Coming to the more juicy stuff, lo’ and behold, ye contents of /lib folder (with comments):
- AkActionController (controller)
- AkActionView (view)
- AkActionWebservice (Web services)
- AkActiveRecord (model)
- AkAdodbCache (content caching)
- AkCharset (utf8 support, includes all mappings)
- AkConfig (load config settings)
- AkConverters (conversions!)
- DBDesigner > AkelosDatabaseDesign
- Excel > Array (bi-dimensional)
- Excel > CSV
- HTML > RTF
- HTML > Text
- Word > Unicode
- PDF > Text
- Xdoc > Text
- AkHeaders (HTTP headers, redirections)
- AkImages (Image operations, resizing)
- AkLocalize (Localization, countries and timezones)
- AkInflector
- AkLogger
- AkFtp
- AkInstaller
- AkRouter
- AkZip
- …
Well, it’s all there, at any rate. The best way to know if it all works, and how it works, is simply to try it out: www.akelos.org.
Remarks
As I said earlier, Akelos looks like CakePHP on steroids: agreed, the Cake philosophy of “no we-may-use-it code in the trunk” has been completely (and intentionally) ignored, but this is our chance to peek at what CakePHP could have become if such philosophy didn’t become a lifestyle for the Cake Dev Team.
Akelos code is Rails-inspired, so yes, it’s very similar to Cake, although with some rough edges and some re-used parts, but it’s the work of ONE person with no community support (yet), don’t forget. Remarkable.
And he needs co-developers, by the looks of it, so there you are then: there’s your chance!
My personal opinion about it? Well, I think Akelos can learn from CakePHP and vice-versa: a merge? Well, at least it would reduce the number of Rails-inspired framework for PHP and possibly meet the needs of more people: those who want just the essentials, as a framework, and those who like to be virtually almighty and be able to do anything, if they wanted to.
Two flavours of the same framework? CakePHP and cAkePHP (note the case)? Bah, let’s stop raving now, shall we?
Posted in Blog | Tags Frameworks, PHP | 1 comment | no trackbacks
Posted by Fabio Cevasco
Sat, 10 Jun 2006 17:26:00 GMT
Someone recently added a comment to my article about Rails-inspired PHP frameworks pointing out that I forgot another Rails-like framework, in my round-up. He obviously posted a link to this rather mysterious Rails port in PHP and spam or not, I’d like to thank this guy for letting me know of the existance of Akelos, a new PHP framework which seems simply too good to be true.

Let me just spend a few words more before writing more about it though. First off, it’s not available yet. OR at least it doesn’t seem to be: the author is planning to release his work to the Open Source community but… well, he’s a bit concerned about the current “PHP Framework War”: he wouldn’t like to end up like Subway or just be slagged off by those merciless reviewers who enjoy write round-ups and comparisons about frameworks. Bermi Ferrer is “just” a talented PHP developer who decided to create his own framework and he really enjoyed doing so, nothing more, nothing less.
“I considered other PHP ports of Ruby on Rails, but we could not find all we needed on them. One feature that I needed on the core was internationalization and Unicode support, so I decided to roll my own framework trying to keep most of the original rails interface so most of its documentation could work for it.”
Where did I hear that? Nothing new: it’s always the same story of frameworks not being as we want them to be etc., it’s human. And yes, it’s another attempt to port Ruby on Rails to PHP, and a damn good one—or so it seems.
Before proceeding any further, I’d like to write a short warning for a few people who may or may not want to pop in and start commenting about the Rails-is-better-than-any-PHP-clone issue: If I see a single comment slagging off this framework (or any other) only because it’s a port of Rails to PHP, it will be deleted, may it be David Heinemeier Hansson himself. Stop it, no seriously, I think it will be counter productive for Rails in the end: I really like RoR and I love the way it works, and yes, I think Ruby is definitely the best language to do that sort of things, EVERYBODY KNOWS THAT. Please, please, save us poor PHP developers the usual preaching.

Right, back to Akelos now. Curious as I am I immediately checked out the official page and all i found was a pretty long list of features which made me dribble, literally… ooops!
Let’s just quote the most juicy ones, shall we?
Active Record [“Model”]
- Associations
- Callbacks
- Transactions
- Finders [
$Project->findFirstBy('language AND start_year:greater', 'PHP', '2004'); ]
- Versioning
- …
Action Controller [“Controller”]
- Filters
- Pagination
- Mime Type
- Mime Response
- Code Generation
- Response handler
- …
Action View [“View”]
- Templates (using Sintags)
- Web 2.0 javascript using prototype and script.aculo.us
- Helpers
- Partials
- Template Compilers
- …
And then more Akelos-only goodies:
- Multilingual Models and Views
- Locale alias integrated on URLS (example.com/spanish will load the es_ES locale)
- Database migrations using DB Designer files
- Pure PHP support for Unicode (no extensions required)
- Unit Tested source code
- Code Generators
- Built in XHTML validator
- Automated locale management
- Clean separation from HTML and Javascript using CSS event selectors.
- Ajax file uploads
- AFLAX integration
- Dojo Rich Text Editor
- Format converters
- File handling using SFTP for shared host running Apache as user nobody (as most CPanel server do)
- Distributed sessions using databases
Impressed? I was, honest. And I’m talking as a CakePHP fanatic here, and I must say that if this framework can really offer all this and - and this is what really matters - is also as simple as Cake to learn and well performing… well, this is definitely going to be quite a promising player in the “PHP Framework War” (but is not a real war, is it?), although the author is quite worried about that:
“I’m also concerned about the PHP Framework war, I don’t want to play that game. Building this Framework was a great experience, it works great for me and it has helped me to become a better programmer so I don’t want to spend my time discussing about if this is better or not than other solutions. That’s the reason I’ll first look for great developers interested in the Framework to help me releasing it.”
Really, this will be an interesting project to check out, once it goes open source, and yes, I really wish Bermi all the best. Good luck, Akelos Framework.
Posted in Blog | Tags Frameworks, PHP | no comments | no trackbacks
Posted by Fabio Cevasco
Sat, 06 May 2006 21:43:00 GMT
When I first tried Ruby on Rails I was literally amazed by the generator script. Yes, I was young and inexperienced then (six/seven months ago), but you must admit that getting a controller, a model, all the basic views generated automatically by
rails script/generator scaffold Posts
is not a bad thing. Especially if the same script allows you to create model, views and controller separately and other things. Symfony and PHP on Trax already tried to port this functionalities, with mixed results. What about Cake? Oh well, yes, we do have something like that… something rather different, but still something: the bake.php script.
This cute little thing is located in the cake/scripts/ folder and can be used – hear, hear – from command line. You can run Ruby and Perl scripts, so yes, you can actually run PHP from command line, although it’s not its primary purpose.

Cool then, let’s open a *nix shell, Windows command prompt, etc. etc., go into the cake/scripts/ folder and run:
php bake.php
Assuming that the php executable is in your PATH environment variable – if not, either you add it or you’ll have to type something like:
D:SERVERphpphp.exe bake.php
depending on where your php executable is. You’ll be be greeted by a “CAKEPHP BAKE” text, and then you’ll be asked a few questions. One thing to realize before proceeding any further: bake.php is not a generator, not in the traditional “Rails” sense, anyway. It’s rather a handy but more verbose dialogue-based configuration script – which will also generate something eventually if you provide all the necessary details.
A different approach, which may be good or bad according to your taste: personally I think we should also have something faster to use, like a Rails generator, and I opened a ticket about it, but let’s see what bake.php can do, for now.
The answer is… nearly anything. It annoying enough to please, but if you follow its directions it can do a prettu decent job in the end, it’s far from being sentient, but let’s say it’s smart enough for a script. First of all if you try it out on a fresh Cake install it will notice that you haven’t configured your database yet, so it will ask for a hostname, username, password, database name etc. etc. and generate your app/config/database.php for you, not a bad start.
Once that’s done – and it won’t go on unless you configure a (MySQL only?) database – you can proceed with the rest. You can start creating either a controller, model or view; I tried a Posts controller, for example. The script then asks quite a few questions:
- The controller’s name
- Whether it will use other models besides posts
- Whether you want to include any helper
- Whether you want to include any component
- Whether you want to generate the base CRUD methods
Then finally it generates the damn thing. The result is good enough:
<?php
class PostsController extends AppController
{
//var $scaffold;
var $name = 'Posts';
function index()
{
$this->set('data', $this->Post->findAll());
}
function add()
{
if(empty($this->params['data']))
{
$this->render();
}
else
{
if($this->Post->save($this->params['data']))
{
$this->flash('Post saved.', '/posts/index');
}
else
{
$this->render();
}
}
}
function edit($id)
{
if(empty($this->params['data']))
{
$this->set('data', $this->Post->find('Post.id = ' . $id));
}
else
{
if($this->Post->save($this->params['data']))
{
$this->flash('Post saved.', '/posts/index');
}
else
{
$this->set('data', $this->params['data']);
$this->validateErrors($this->Post);
$this->render();
}
}
}
function view($id)
{
$this->set('data', $this->Post->find('Post.id = ' . $id));
}
function delete($id)
{
$this->Post->del($id);
$this->redirect('/posts/index');
}
function postList()
{
$vars = $this->Post->findAll();
foreach($vars as $var)
{
$list[$var['Post']['id']] = $var['Post']['name'];
}
return $list;
}
}
?>
It’s more or less the same with models and views: it will still ask a lot of questions and in the end generate the thing.
This behaviour is more advanced than a standard generator, you can include helpers and components already, if you want, but do you really want that? For models it even asks if you want to include particular associations and validation rules! Personally, I’d rather a generator script which generates something immediately and accepts maybe some parameters to further customization, like:
php bake.php scaffold Posts
php bake.php controller Posts
php bake.php model Posts
php bake.php model Posts
php bake.php controller Posts helper +Html -Time,Javascript
php bake.php model Posts assoc +hasMany comments,tags
Bah… just some random thoughts. How about custom-made generators (Rails-inspired)?
Posted in Blog | Tags CakePHP, Frameworks | no comments | no trackbacks
Posted by Fabio Cevasco
Wed, 03 May 2006 20:57:00 GMT
There are various articles online examining many PHP frameworks, providing short reviews or comparative charts, but I could not find yet an article examining the so called “Rails-inspired frameworks” anywhere on the web, so I decided to write my own…
IMPORTANT UPDATE: I do no longer recommend the CakePHP framework anymore due to the unprofessionalism of some member of its development team. My site is now powered by Ruby on Rails and I totally lost interest in PHP and any PHP framework. If you are looking for a decent web framework, try Ruby on Rails (for Ruby), Django (for Python) or Catalyst (for Perl).
Read more...
Posted in Articles | Tags CakePHP, Frameworks, Rails, review | 5 comments | no trackbacks