on Articles Reviews

CakePHP 2.0 released: What’s new?

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInShare on RedditShare on StumbleUpon

“CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code. ”

And now, it even got better. After a year and a half of coding, CakePHP 2.0 is released.

I will first talk about some cool new features and explain some of them later.

New features

CakePHP 2.0 completely dropped the PHP 4 support and is now supporting PHP 5.2.6 and above. This was expected.


The model construction process has been made lighter. Model associations are now lazy loaded, applications with lots of models and associations will see great time reductions in the bootstrap process.

Now models won’t require a database connection in the construction process. The database will be accessed for the first time only when a find operation is issued or information for one of the columns is required.


View will now always have the last rendered content (view or layout) accessible through $this->output. In helpers you can use $this->_View->output. Modifying this property will change the content that comes out of the view rendering.


There are some interesting new features inside powerful CakePHP Helpers:

Error handling

The error handling implementation has dramatically changed in 2.0. Exceptions have been introduced throughout the framework, and error handling has been updated to offer more control and flexibility.


All of the core test cases and supporting infrastructure have been ported to use PHPUnit 3.5. Of course you can continue to use SimpleTest in your application by replacing the related files.

No further support will be given for SimpleTest and it is recommended that you migrate to PHPUnit as well.

Database Objects

Cake 2.0 introduces some changes to Database objects that should not greatly affect backwards compatibility. The biggest one is the adoption of PDO for handling database connections.

If you are using a vanilla installation of PHP 5 you will already have installed the needed extensions, but you may need to activate individual extensions for each driver you wish to use.


CakePHP features not only a web framework but also a console framework for creating console applications. Console applications are ideal for handling a variety of background tasks such as maintenance, and completing work outside of the request-response cycle. CakePHP console applications allow you to reuse your application classes from the command line.

CakePHP comes with a number of console applications out of the box. Some of these applications are used in concert with other CakePHP features (like ACL or i18n), and others are for general use in getting you working faster.

One of the cool things is that the console app is now colorized to easier spot error messages and other critical information.


CakePHP 2.0 is a great step for this framework. I mentioned only the biggest features but there are even more.

I am looking forward to write some tutorials, benchmarks and reviews on CakePHP 2.0 to see how it really works in a real world examples. So, stay tuned.

What do you think of CakePHP framework? What frameworks do you use?

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInShare on RedditShare on StumbleUpon

  • Noel

    I am glad to see that great CakePHP has reached the new version. Plenty of new features is mentioned. I can not wait to have a new project and build it in CakePHP.

    I just hope that it will be faster then before.

    Nice post, BTW.

  • Tim

    I have started using CakePHP 2.1 (most recently) as my primary application development framework. If I could recommend any tutorials, I think a PHPUnit configuration (working) would be very helpful 🙂