Stable Release in branch 2.3
2.3.10
Released 30 Aug 2013
(12 years ago)
SoftwareCakePHP
Version2.3
Status
End of life
Supported
PHP versions
PHP 5.4-7.4
Initial release2.3.0
28 Jan 2013
(13 years ago)
Latest release2.3.10
30 Aug 2013
(12 years ago)
End of security fixesUnavailable
Release noteshttps://github.com/cakephp/cakephp/releases/tag/2.3.10
Source codehttps://github.com/cakephp/cakephp/tree/2.3.10
Documentationhttps://book.cakephp.org/2/en/index.html
Downloadhttps://book.cakephp.org/2/en/installation.html
CakePHP 2.3 ReleasesView full list

What Is New in CakePHP 2.3

CakePHP 2.3 delivers incremental refinements and essential updates. It focuses on shoring up existing features, improving consistency, and marking older methods for future removal. This release is about polish and preparation.

Category Key Changes
New Features New Security component callbacks, Hash utility enhancements, Cache engine improvements.
Improvements Better FormHelper and Paginator consistency, refined routing, updated core dependencies.
Deprecated / Removed Several methods in View, Helper, Controller, and Router are now deprecated.
Bug Fixes Various fixes across the core, helpers, and components for more stable operation.

How is the Security Component more flexible now?

The SecurityComponent gained new callback hooks, giving you finer control over the blackhole process. You can now define blackHoleCallback and requireAuthCallback methods in your controller.

In practice, this means you can implement custom logging or user redirection when a security check fails, instead of just throwing a 400 error. It moves security handling from a rigid stop to a manageable event in your application flow.

// In your AppController
public $components = array(
    'Security' => array(
        'blackHoleCallback' => 'customBlackhole'
    )
);

public function customBlackhole($type, $exception) {
    // Log the attempt
    $this->log("Security blackhole: {$type}");
    // Redirect users gracefully
    $this->redirect(array('action' => 'dashboard'));
}

What got better in the Hash utility class?

The Hash class received new methods like mergeDiff and expand, making array manipulation more powerful. Hash::mergeDiff merges arrays while ignoring null values from the second array, which is useful for partial updates.

Hash::expand converts a flat, dot-notated array back into a nested, multi-dimensional array. This pairs perfectly with Hash::flatten, giving you a complete toolkit for data structure transformation.

$flat = array('User.name' => 'John', 'User.Profile.id' => 123);
$nested = Hash::expand($flat);
// Result: array('User' => array('name' => 'John', 'Profile' => array('id' => 123)));

Which parts of the framework are now deprecated?

CakePHP 2.3 starts the deprecation cycle for several methods to clean up the API before 3.0. Key deprecations include View::loadHelpers(), Helper::webroot(), and Controller::postConditions().

Common Deprecated Methods

  • Router::parseExtensions() - Use Router::extensions() instead.
  • View::loadHelpers() - Declare helpers in the controller's $helpers array.
  • Helper::webroot() - Use Router::url() or the HtmlHelper::url() method.
  • Controller::postConditions() - Use Model->conditions or manual array building.

You'll see E_USER_DEPRECATED notices if your code uses these. Start updating now to avoid breaks in the next major version.

How did FormHelper and Paginator improve?

Both helpers saw changes for greater consistency. FormHelper::input() now respects the type key in the options array more reliably, preventing unexpected field type changes.

The PaginatorHelper got updates to its sorting links (sort() and sortKey() methods) and number formatting (numbers() method). These changes make the output more predictable and align with common usage patterns, reducing those minor layout surprises.

FAQ

Should I upgrade to CakePHP 2.3 immediately?
Yes, it's a recommended update. It contains important bug fixes and the deprecation warnings give you a head start on migrating to 3.0. The changes are largely non-breaking for standard applications.

What's the deal with the new Cache engine changes?
The FileEngine and WincacheEngine were updated. FileEngine now uses a more efficient serialization method by default (PHP serialization instead of JSON) for better compatibility with complex data. You can configure this via the serialize option.

I use postConditions() in my controllers. What should I replace it with?
The Controller::postConditions() method is deprecated. You should manually build your conditions array or use your Model's conditions logic directly. This change encourages more explicit and testable code in your controllers.

Are there any changes to how extensions are parsed in URLs?
Yes. The Router::parseExtensions() method is deprecated. Use Router::extensions() to define valid extensions for parsing. This aligns the method name with its static nature and simplifies the API.

Does the updated Hash utility break existing code?
No, it's fully additive. The new methods like mergeDiff and expand provide new functionality without altering the behavior of existing methods like merge, flatten, or extract.

Releases In Branch 2.3

VersionRelease date
2.3.1030 Aug 2013
(12 years ago)
2.3.912 Aug 2013
(12 years ago)
2.3.817 Jul 2013
(13 years ago)
2.3.704 Jul 2013
(13 years ago)
2.3.609 Jun 2013
(13 years ago)
2.3.511 May 2013
(13 years ago)
2.3.428 Apr 2013
(13 years ago)
2.3.324 Apr 2013
(13 years ago)
2.3.207 Apr 2013
(13 years ago)
2.3.102 Mar 2013
(13 years ago)
2.3.028 Jan 2013
(13 years ago)
2.3.0-RC208 Jan 2013
(13 years ago)
2.3.0-RC102 Dec 2012
(13 years ago)
2.3.0-beta28 Oct 2012
(13 years ago)