Posted by h3rald
Sun, 02 Sep 2007 12:41:00 GMT
Today I was not going to post on my blog. I have the flu, I don’t feel very well so I started reading some news feeds on Google Reader. That lasted for about half an hour, so I decided to check my old Netvibes account where I kept other feeds, including a bunch of CakePHP-related blogs.
Two posts immediately grab my attention:
I don’t trust CakePHP or what should you say in public?
and
Bye, bye, CakePHP team
They’re both from Daniel’s cakebaker blog, the one I used to read when I was really into Cake.
To cut a long story short, apparently Daniel said something wrong and he got “what he deserves” for speaking out. Naughty boy!
That’s because it might have put “CakePHP and the team in a bad light”. Well, I don’t know about that, but definitely now it IS in a bad light!
I even found a bunch of comment which link this incident to what happened to me a few months ago:
“I said it when Fabio/H3rald left, and I’ll say it again—I think the biggest weakness of Cake is that the core dev team is quick to cut people out who don’t hold to every dogma the devs do. Fundamentalism, ego, call it what you will, a great community will only count for so long if the core keeps alienating its biggest allies. (not that they’re neccessarily alienating you, dho. I truly hope you stick around. You do seem to be taking it well.)”
^ Whoever you are, you’re 100% right.
A core asset (at least for his writings) of the CakePHP team is gone, and another (big) chunk of CakePHP PR strategy is out of play, now, it seems. While I’m sorry the CakePHP community has to get the butt-end of it as always, I’m certainly happy for Daniel who, like me, will now have a chance to look around and experiment with new things. That’s right man, Rails or Django are the way to go.
Posted in Blog | Tags CakePHP, rant, writing | 3 comments | no trackbacks
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
Fri, 09 Mar 2007 18:59:00 GMT
My fiancée keeps telling me that too many cakes are not good for me, and I never listen: I always liked cakes! I did like the CakePHP™[1] framework too, once, and I did write some articles about it in the past, and I believe at least a bunch of Bakers found them useful, especially at the time.
I do believe the Cake™ Software Foundation1 quite liked having their framework featured on popular websites like php|architect and SitePoint, and I believe that I contributed – to some extent – to make it one of the most popular frameworks available for the PHP programming language.
Read more...
Posted in Blog | Tags CakePHP, rant, writing | no comments | no trackbacks
Posted by Fabio Cevasco
Wed, 07 Mar 2007 09:45:00 GMT
I am sorry to announce that my upcoming book, CakePHP Recipes, will not be published anymore. As a matter of fact, it wasn’t finished because some of the people involved failed to comply with the terms of their contract in delivering material which was suitable for publication.
To quote an email I received from my publisher a few days ago,
“[…] The Cake Software Foundation has informed us they are withdrawing from the CakePHP Recipes project, and returning the advances they’ve received. This means we can no longer count on them for support, nor can we package the book as an official title.
After careful consideration, we have determined that this renders the book no longer viable for us. So, regrettably we must cancel your contract as well. Please understand that we have no quarrel with your performance; you have been responsive and communicative for the entire time. […]”
This is a huge disappointment to me, in particular because I am not responsible for the cancellation. It was going to be my very first book to be published, and due to someone else’s misjudgement and lack of motivation it will never be available to the readers.
I do not want to put the blame the whole Cake Software Foundation for this: nearly every person involved in the project did his best in reviewing parts of the book or offering me support. Regrettably this wasn’t enough: unfortunately it seems that someone didn’t like the idea of me writing the book and kept doubting not only my coding skills but also my ability as a writer all along.
It is sad to see how certain individuals fail to understand the importance of marketing and public relations not only when working on a team project but also in ordinary life, but it is truly disappointing to see how the thoughts and opinions of a single individual affect the work of a whole team.
Posted in Blog | Tags CakePHP, writing | 14 comments | no trackbacks
Posted by Fabio Cevasco
Thu, 02 Nov 2006 12:25:00 GMT
Despite all my efforts to keep the whole thing quiet for the time being, a few days ago I entered the words “CakePHP Recipes” in Google and discovered – to my astonishment – that my new book about the CakePHP framework is already for (pre)sale in many popular online bookstores.
Up to now I never made any formal announcement myself (although the Cake Software Foundation already did, months ago), nor gave out any juicy details about it, but maybe now the time has come to post something more about it. Yes, I am indeed writing a book about the CakePHP framework, and yes, you can already buy it but no, you can’t phisically get it simply because it’s still in progress (miracles of the modern publishing industry!).

I’d like to point out that I’m not the only author of the book: all the code examples and snippets included in the book is provided by the Cake Software Foundation staff, in the person of Larry E. Masters and Garrett J. Woodworth mainly, who will also act as technical editors and first reviewers of the book, together with other trusthworthy CakePHP core developers.
It is our intent to produce an enjoyable and yet very useful book which will hopefully help CakePHP enthusiasts to use the framework in real-world situations: the book will not focus on theory but on practice, by providing a lot of interesting “recipes” on how to implement a particular functionality in a CakePHP web application.
Why should you get it? Here are some reasons:
- It is a book written by programmers for programmers
- All the code included in the book has been created and tested by the creators of the framework
- Part of all the revenues generated by the book (including royalties) will go to the Cake Software Foundation, and hopefully contribute to improve our already excellent framework.
Very special thanks to Peachpit Press for giving me and the Cake Software Foundation this chance to
More to come…
UPDATE: This book has been canceled and therefore will NEVER be available in bookshops or online stores.
Posted in Blog | Tags CakePHP, writing | 3 comments | no trackbacks
Posted by Fabio Cevasco
Tue, 25 Jul 2006 09:07:00 GMT
Quite a bit of time passed since the last blog post, and I’m actually sorry about that, but as I thought, I don’t have as much free time as I used to be. Work is work, after all!
This post will be multipurpose as actually I bluid up a few things to write about in the last few days… erhm, ok, weeks.
New Website Design
Something different eh? Yep, definitely! Some time ago I started a small project called h3raLd.com Re-design hoping that some GFX guru could provide a new template for this website, and actually in the end I decided to accept the work of Bartus F. Teipel a Brazilian CakePHP enthusiast.
Bartus is obviously (MUCH) more talented than me when it comes to design, and I was amazed at the quality of the template he provided, in a really short time.
Unfortunately he didn’t yet provide a link to his main website/portfolio, but for now all I can show you is his website for party pics, CircusCircus.
The new template sports a more contemporary Web2.0-ish look which I like a lot, and Bartus used libraries like prototype, moo.fx and Nifty Corners Cube for the AJAX effects and functionalities.
A really outstanding work, thanks Bartus!
The CakePHP Herald project has been completed
With my latest article about CakePHP published on SitePoint, the CakePHP Herald project was completed.
I must say that I really enjoyed writing all those articles about CakePHP, and the only thing I regret is not to have written anything (yet) about some more advanced topic about CakePHP. This was mostly due to – again – lack of time to focus on advanced topic and produce some quality examples.
However, judging by the positive feedback I received about the articles, I am really happy of the final result: even more people discovered the power of CakePHP and became bakers. Happy baking to all of you!
So… no more articles about Cake? Maybe not for a while, I think I’ll be rather busy in the following months. Curious? Read on :-)
My biggest and most important project
I actually got really pissed off with Larry, Garret & the other Master Bakers because of what they wrote on the announcement for the latest CakePHP release:
“[…]In other news, some new articles were published on Sitepoint [3] and in the International PHP magazine [4]. Fabio Cevasco [5] is the man behind these articles. Together with Fabio, we will be writing a book that will be published […]”
After all this time I spent trying desperately not to say a word about it they came out and heralded it out of nowhere. Sigh… they ruined the surprise effect! Oh well, it’s too late now, isn’t it?
So yes, when I say that I’m spending at least 60% of my time (at work and at home) writing I really mean it. The rest? Well, I do have a lovely girlfriend after all!!!
Posted in Blog | Tags CakePHP, design, website | no comments | no trackbacks
Posted by Fabio Cevasco
Fri, 14 Jul 2006 10:03:00 GMT
According to a recent study, PHP is one of the most popular programming languages in the world. In spite of this, PHP is often criticized for its inconsistent naming conventions, its lack of important features as compared to other languages (like namespaces) and its inherent disorganization. Furthermore, PHP is very easy to learn, and this has often led to the common misconception that most PHP developers are inexperienced and that their code is therefore prone to security vulnerabilities and exploits.
Read more...
Posted in Articles | Tags CakePHP, review, tutorial | no comments | no trackbacks
Posted by Fabio Cevasco
Sat, 20 May 2006 21:47:00 GMT
Tutorials are great, articles are helpful, manuals are essential and the API is your best friend, but there’s still something missing there… Unfortunately podcasts are not yet available, but the CakePHP team is proud to announce the creation of two screencasts in an effort to help new bakers familiarizing with CakePHP’s concepts.
This is old news now, the screencasts section came together with the site overhaul but I only got a chance to take a look at them (one of them only, to be totally honest) recently, and so here’s a spoil… erhm, a detailed description of John Anderson’s screencast about the Blog Tutorial.

There’s something I’ll never do: a screencast. Recording every mouse movement, every word or piece of code typed in half an hour? No way! And what happens if I mistype something? People will keep pointing out the fact that I was starting to type </h2> to close a </h1> tag, or that I waited an eternity like five full seconds before deciding what to do. I guess I’m quite paranoid… John did it, and he did it well. Using just bash, vim and Safari he was able to record an excellent 30-minutes screencast featuring the blog tutorial.
Before people start complaining that the blog tutorial should be completed in fifteen minutes, keep in mind that John’s screencast is meant to show everything clearly to new users, via a trial and error approach if necessary.
Here’s what happens in the screencast, nothing new if your read the blog tutorial, but still interesting, especially if you’re new to Cake. Unfortunately there’s no audio, but the video talks by itself and John will occasionally write some comments here and there.
0:01 – 5:00
- SVN checkout to get the latest CakePHP version
- make app/tmp writeable
- execute queries (table posts)
- insert some test posts
- create database config file: modify 3 lines of database.php
- CakePHP is now able to connect to database
- create app/models/post.php model
- create posts_controller.php [John uses Vim as preferred PHP editor]
- try to access /posts/, error: missing method index()
- create function index() in postscontroller.php able to fetch posts
- refresh, missing index view
- create index.thtml displaying the raw posts array
5:01 – 10:00
- index.thtml: display posts with table and foreach iteration
- add hyperlink in index.thtml to view posts
- access /posts/view/1 -> missing method view()
- add view() method in postscontroller.php
- create view.thtml to display
- Raw view post with pre tags and print_r()
10:01 – 15:00
- display post properly with
<p> tags
- add link in index.thtml to add a post
- missing method -> add()
- add add() in controller
- missing view [trial and error, trial and error…]
- create add.thtml, using the Html Helper to create input tags easily
15:01 – 20:00
- add.thtml (continued)
- testing add form
- view added post
- start adding another (for validation purposes) [stop before submitting]
- modify post.php model, valid_not_empty for title and body
- modify view to trigger validation
$html->tagErrorMsg()
- test: no body, message displayed
- test: no title, message displayed
- add another post, everything works
- [pause: five seconds]
- back to the controller, create delete() function
20:01 – 25:00
- delete function (continued)
- add “Actions” table column in index.thtml, with link delete post
- delete two posts
- take a breath
- add link in index.thtml to edit post
- refresh page, mouse over edit links…
- back to controller, add edit function [we learnt abour CakePHP errors alright]
25:01 – 27:38
- pause, 5 sec [should I write edit.thtml from scratch]
- copy add.thtml as edit.thtml
- change just the title and form action
- [pause: 3 sec]
- test edit link
- edit a post
- move around, switch views
- edit config/routes.php
- set default route to posts/index
- refresh – all done!
That’s it. All in a 40MB .mov file. Download it from here.
Posted in Blog | Tags CakePHP, tutorial | no comments | no trackbacks
Posted by Fabio Cevasco
Mon, 08 May 2006 17:50:00 GMT
Right after my last blog post I decided to log on #cakephp on irc.freenode.org as usual, and gwoo pops in and says “h3raLd, you didn’t review rdBaker yet!”
That’s right, I didn’t yet, so I may as well do it today.
I remember hearing about rdBaker months ago, waaay before CakePHP 1.0, way before the RCs, I remember someone mentioning it on CakePHP user group in right after the bake.php script was created. “How about having an online baking utility?” – and that’s precisely what rdBaker is, a more PHP-ish version of bake.php, which runs like any other PHP scripts: in your browser.
This cute little thing is obviously available for free on CakeForge and is part of gwoo ’s rdOpenSource project which includes various other Cake-powered applications.
I personally recommend new (and old) bakers to download them and play with them, try to understand how they were coded, because they can really teach you a lot on how to code a CakePHP application or website properly.
So anyway, get your copy of rdBaker, unzip it and have a look at the README.txt file for the installation instructions:
1. Place rdBaker in the root along side /cake_install/app.
2. chmod /cake_install/rdBaker/tmp to 0777
3. launch http://localhost/cake_install/rdBaker/
Not too hard, innit?

Good. So you try accessing something like http://localhost/php/test/cakephp/cake_test/rdBaker/ (that’s on my own local WAMP server) and you’ll get a nice page asking you to “supply your ingredients” via a simple form.
Unlike its command line cousin, rdBaker doesn’t require you to fill in all the fields, but just the full path to the save directory (which is normally already filled in) and of course the name of the model (Post, User, Comment).
Then you can select the type of output and choose whether you want to generate an empty controller, a scaffolded one or the full option including all the most common CRUD methods.
Finally – if you like – you can enter any association or valitation rules for your model, then press the Bake it! button and voilá, in you’ll find three directories (controllers, models and views) in your save directory containing all the MVC entities you need regarding a particular model:
rdBaker Result Array
(
[0] => notes_controller.php created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpcontrollers
[1] => note.php created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpmodels
[2] => index.thtml created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpviews/notes
[3] => add.thtml created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpviews/notes
[4] => edit.thtml created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpviews/notes
[5] => view.thtml created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpviews/notes
)
But there’s more! By checking the appropriate checkbox, you can get all the stuff packed in a zip file!
Not bad at all, and fast as well.
Now the bad things…
The script works fine, but there’s something which could be improved, perhaps:
* If you choose to put everything in a zip file, the file will be named “baked_by_rdBaker.zip” – not a big deal, but maybe it could be personalized according to the model name entered.
* Regardless you want to add validation rules to your model or not, you’ll
always find some validation rules for a
title and
body field. I checked and they are hardcoded in the template file (rdBaker/views/helpers/templates/full/model.txt):
var $validate = array(
'title'=>VALID_NOT_EMPTY,
'body'=>VALID_NOT_EMPTY);
* In the baked index.thtml view, there will always be a column named “Title”. This, again, is hardcoded in the template.
Other than these things, everything seems to work fine. A really nice script!
Posted in Blog | Tags CakePHP | 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