Stable Release in branch 3.2
3.2.14
Released 12 Aug 2016
(10 years ago)
SoftwareCakePHP
Version3.2
Supported
PHP versions
PHP 5.6-7.4
Initial release3.2.0
29 Jan 2016
(10 years ago)
Latest release3.2.14
12 Aug 2016
(10 years ago)
End of security fixesUnavailable
Release noteshttps://github.com/cakephp/cakephp/releases/tag/3.2.14
Source codehttps://github.com/cakephp/cakephp/tree/3.2.14
Documentationhttps://book.cakephp.org/3/en/index.html
Downloadhttps://book.cakephp.org/3/en/installation.html
CakePHP 3.2 ReleasesView full list

What Is New in CakePHP 3.2

CakePHP 3.2 introduces several key updates focused on the ORM, routing, and internal components. This release adds new features for building complex queries, refines the dispatcher filter system, and includes numerous improvements for a smoother development workflow.

Category Key Changes
New Features Eager loader interface, notMatching() query method, nested route prefixes.
Improvements Dispatcher filter refactoring, enhanced FormHelper, better fixture handling.
Deprecated Configuring Cache engines with class names, several methods in Component and Helper.
Bug Fixes Various fixes across ORM, Database, View, and Console libraries.

How is the ORM and Query Building Enhanced?

The ORM receives powerful new tools for managing associations and building queries. The most significant addition is the notMatching() method, which lets you find records that are not associated with a given target.

This is useful for scenarios like finding articles without any tags. Under the hood, it uses a LEFT JOIN with a WHERE IS NULL condition. The eager loader system also gets an interface, allowing for more customized data loading strategies beyond the built-in select and joined methods.

Example: Using notMatching()

// Find authors who have not written any articles
$authors = $this->Authors->find()->notMatching('Articles');

What Changed in Routing and the HTTP Layer?

Routing now supports nested prefixes, giving you more flexibility in organizing grouped routes. You can define prefixes like /Admin/API within your scope configuration.

The dispatcher filter system has been refactored into a middleware-oriented architecture. While the old DispatcherFilter interface still works, the new approach uses the Middleware interface from the Http\Server namespace. This change sets the stage for a more modular request/response pipeline.

Are There Updates for Helpers and Components?

Yes, several helpers and components have been improved or marked for future removal. The FormHelper now better handles datetime fields when used with the datetime-local input type, ensuring correct value formatting.

On the deprecation side, methods like Component::__get(), __set(), and __isset() for accessing other components are now deprecated. The same applies to the Helper::__get() and __set() magic methods. You should use the get() and set() methods or request components via the registry instead.

How is Cache Engine Configuration Different?

Configuring Cache engines using a class name as a string is now deprecated. This practice was common but less explicit. The new method is to use an instance of the cache engine instead.

Old vs. New Configuration

// Deprecated way
'Cache' => [
    'short' => [
        'className' => 'File',
    ]
]

// New way
use Cake\Cache\Engine\FileEngine;

'Cache' => [
    'short' => [
        'className' => FileEngine::class,
    ]
]

This change makes dependency injection and configuration more consistent with the rest of the framework's style.

FAQ

What is the main use case for the new `notMatching()` query method?
It's designed to find records that lack a specific association. A typical example is selecting all customers who have not placed an order, or products that haven't been categorized. It simplifies a query pattern that previously required a custom LEFT JOIN or a subquery.

Why were the magic methods in Component and Helper deprecated?
Using magic methods like __get() to access other components made the code less transparent and harder for static analysis tools to follow. The framework now encourages using the explicit get() and set() methods or the component registry, which makes dependencies clearer.

Does the dispatcher filter change break my existing application?
No, the old DispatcherFilter interface still functions in 3.2, so your current filters will work. However, you should plan to migrate to the new Middleware interface in future development, as it represents the modern direction for handling HTTP requests in the application.

How do nested route prefixes help in organizing my code?
They allow you to create a more hierarchical structure for your routes. For instance, you can group all API endpoints under an /Admin area by scoping them with a nested 'prefix' => 'Admin/Api'. This keeps your route definitions cleaner and more logical when you have complex access control layers.

What should I do immediately about the deprecated Cache engine configuration?
Update your app.php configuration file to use the engine class instance (e.g., FileEngine::class) instead of the string name ('File'). This is a straightforward search-and-replace task that will prevent deprecation warnings and ensure forward compatibility.

Releases In Branch 3.2

VersionRelease date
3.2.1412 Aug 2016
(10 years ago)
3.2.1301 Aug 2016
(10 years ago)
3.2.1208 Jul 2016
(10 years ago)
3.2.1120 Jun 2016
(10 years ago)
3.2.1026 May 2016
(10 years ago)
3.2.916 May 2016
(10 years ago)
3.2.824 Apr 2016
(10 years ago)
3.2.710 Apr 2016
(10 years ago)
3.2.628 Mar 2016
(10 years ago)
3.2.513 Mar 2016
(10 years ago)
3.2.406 Mar 2016
(10 years ago)
3.2.321 Feb 2016
(10 years ago)
3.2.211 Feb 2016
(10 years ago)
3.2.130 Jan 2016
(10 years ago)
3.2.029 Jan 2016
(10 years ago)
3.2.0-RC103 Jan 2016
(10 years ago)