CakePHP 2.2 and 2.1.4 released

by lorenzo
The CakePHP core team is proud to announce the immediate availability of both CakePHP 2.2.0 stable and 2.1.4 which is the final bugfix release for the 2.1.x branch

The CakePHP team is proud to announce the immediate availability of CakePHP 2.2.0 stable. As mentioned in previous releases, 2.2 is a API compatible release with 2.1 and should be generally transparent when upgrading, except for a few additions you need to make in configuration files. In addition to this release we have also tagged version 2.1.4 which would be the last work we do on the 2.1.x series. Any further stability fixes will be done in 2.2 branch, so we encourage people to upgrade your apps as soon as possible.

CakePHP 2.2 comes with a great set of new features and goodies, here is a quick summary of what you can find after upgrading:

  • Dispatcher filters, a lightweight way of attaching callbacks as middleware to the dispatcher lifecycle for easier caching or faster action responses.
  • New rich api for creating and removing validation rules on the fly for models
  • Seamless pagination for custom find types
  • Support for real nested database transactions
  • Cache groups, a nice way for tagging and mass deleting cache entries using such tags
  • Improved logging support, several new utility methods were added to CakeLog
  • Configure class can now dump stored values into any persistent storage
  • AuthComponent now accepts contain as a key for storing extra user information in session
  • Several improvements to CakeEmail, such as custom header charset, custom themes, setting links domain and custom helpers defined at configuration time
  • PUT and DELETE requests encoded with application/x-www-form-urlencoded will have its data placed into CakeRequest::$data
  • Set class was deprecated in favor of Hash, a faster and more reliable implementation
  • CakeTime is now timezone aware and fully capable of translating dates from one zone to the other
  • CakeTime can now also accept DateTime objects in addition to strings and timestamps
  • FormHelper now shows more reliably required fields based on validation rules
  • HtmlHelper::tableHeaders() now supports setting attributes per table cell.
  • Better web tester experience
  • Improved error handling, featuring custom fatal error templates
  • Redis support for caching
  • Added new validation methods for upload checking and natural numbers

Please make sure you read the complete migration guide available at

If you were following each release for 2.2 and 2.1, here's a summary of the changes that made into this final iteration:


  • Fixtures will not be loaded again if associated tables exist already in database, making it possible to load fixtures as SQL
  • Better error message in MissingConnectionException when driver is not enabled
  • Better locale support for numbers in Number helper
  • Test suite to fail louder if PHPUnit was not found
  • Small improvements to debug functions
  • Fixed issues in data validation when using beforeValidate callback to change internal model data
  • Improving reliability in page numbers links for PaginatorHelper
  • Increased compatibility with CentOS servers
  • Reduced chance of cache collision in internal method cache for DboSource
  • Fixed issues with default exception renderer and custom helpers
  • Allow Set::extract() to match null.
  • Small bugfixes in XmlView
  • Fixed bugs in Translate Behavior
  • Set session.gc_maxlifetime by default.
  • Fixed bugs in sessions when using long numeric keys in arrays


  • More descriptive diffs in web test runner for failed tests
  • Complete E_STRICT compliance
  • Bug fixes for CakeTime timezone support
  • Helpers can now be defined at configuration time for sending emails.
  • Console commands are now grouped by plugin, core and app shells are always listed last.
  • Fixed small issues with ModelValidator and improved performance

View the complete changelog available for 2.2.0 [1] and 2.1.4 [2]. Download a packaged release [3]

CakeFest 2012 is around the corner and we already expect awesome talks and workshops during the best PHP conference out there. If you haven't booked your tickets yet, it's about time your do, don't miss your chance as we're still offering early bird prices!!

As always, thanks to the friendly CakePHP community for the patches, documentation changes and new tickets. Without you there would be no CakePHP!



More on News




  • soldoncakephp posted on 07/09/12 05:01:13 PM
    I have had performance issues on a Cake site...and run into the following so I have decided to abandon CakePHP:

    1. Difficult to upgrade from one version of Cake to another...constant changes to Cake make a larger app difficult to migrate
    2. Slow slow slow slow. I have upgrading hosting environment multiple times now even with 1.5GB of ram in my cloud environment it is still slow. I am abandoning Cake and writing from scratch in PHP 5.
    3. Successfully was using Sluggable Behavior to create a Shopping Cart platform using multiple tables...then in Cake 2.0 it no longer works, not even part of the framework. Can't find reliable examples of how to port to Cake 2.x.
    4. Documentation improvements: I don't expect you to write my app for me...but it would be nice to have a bit more of an example...what does the development team really suggest as far as a solid example with skinny Controllers, Model examples, etc.?

    I also was curious about the Lithium Framework but last time I checked it looks like it died before 1.0 Stable.
  • siavashmusic posted on 07/03/12 08:44:54 PM
    hello cakephp,

    I like the console method and i use it in my all projects .

    I have a question :
    what is this new tag IN THE CONSOLE: <-[36m

    if you run an api function on the console , you will see this wired tags !
    i just run : cake bake myappname

    like this:
    <-[36mWelcome to cakePHP v2.2.0 console <-[0m


    • gunner1095 posted on 07/07/12 07:51:37 PM
      hello cakephp,

      I like the console method and i use it in my all projects .

      I have a question :
      what is this new tag IN THE CONSOLE: <-[36m

      if you run an api function on the console , you will see this wired tags !
      i just run : cake bake myappname

      like this:
      <-[36mWelcome to cakePHP v2.2.0 console <-[0m

      WHAT IS IT?

  • Jleagle posted on 07/02/12 07:36:44 AM
    How do you update form 2.1 to 2.2?
login to post a comment.