2.8.9

Latest release in branch 2.8
Released 9 years ago (September 19, 2016)

Software CakePHP
Branch 2.8
First official release version 2.8.0
First official release date 10 years ago (February 07, 2016)
Supported
PHP versions
PHP 5.4-7.4
Release notes https://github.com/cakephp/cakephp/releases/tag/v2.8.9
Source code https://github.com/cakephp/cakephp/tree/v2.8.9
Documentation https://book.cakephp.org/2/en/index.html
Download https://book.cakephp.org/2/en/installation.html
CakePHP 2.8 Releases View full list

What Is New in CakePHP 2.8

CakePHP 2.8 is an iterative release focused on maintenance, security enhancements, and smoothing the upgrade path to the 3.x series. It introduces several new features, deprecates outdated APIs, and fixes a number of issues.

Category Key Changes
New Features New CakeRequest and CakeResponse classes, Hash path syntax improvements, Security utility enhancements.
Improvements Better session handling, updated core dependencies (like SwiftMailer), and refined exception messages.
Deprecations Marking many 2.x APIs as deprecated to prepare for removal in 3.0, including certain View, Helper, and Component methods.
Bug Fixes Corrections across the framework, including fixes in ORM, View, Console, and Network libraries.
Security Strengthened cipher seeding and improvements to the Security component.

What are the new core request and response classes?

CakePHP 2.8 introduces CakeRequest and CakeResponse as formal replacements for the older $this->request and $this->response properties in controllers. In practice, you can now type-hint these classes in controller methods, which makes testing and method signature clarity better.

The old array-based access still works, but using the new objects is the forward-compatible way. This change aligns the 2.x codebase closer with patterns used in CakePHP 3.x.

How has the Hash utility improved?

The Hash class now supports a more expressive path syntax for extracting data. You can use {n}.Post and {s}.Post patterns to match numeric or string keys, which gives you finer control over data manipulation.

// New syntax example
$result = Hash::extract($data, '{n}.Post.title');

This expands the utility of a core class that's heavily used for working with nested arrays, common when dealing with CakePHP's model results.

What should I know about deprecated features?

A significant part of 2.8 is flagging methods and properties for removal in 3.0. You'll see deprecation warnings for things like View::loadHelpers(), Helper::loadConfig(), and the $base parameter in HtmlHelper::link().

Running your app with Configure::write('debug', 2); will show these warnings in the debug toolbar. Addressing them now makes the eventual jump to 3.x much smoother. The CakePHP ecosystem is signaling the shift towards modern, namespaced code.

Security and Session Handling Updates

The cipher seed used for security operations is now stronger. Session handling saw tweaks to improve reliability, especially around session timeouts and data management.

These are under-the-hood improvements. For developers, it means the framework's foundation for secure data handling is more robust without requiring changes to your application code.

FAQ

Is CakePHP 2.8 a major new version?
No, it's a maintenance release within the 2.x series. The primary goals are security, bug fixes, and deprecating old APIs to prepare for 3.x. Think of it as a bridge, not a rebuild.

Will my existing 2.7 application break if I upgrade to 2.8?
It should not break, but you may see deprecation notices. Check these notices and update the flagged code over time. The backward compatibility promise for the 2.x series is maintained.

What is the most important change for future compatibility?
Start using the new CakeRequest and CakeResponse objects instead of the array-based properties. This is the most significant pattern change that directly aligns with CakePHP 3.x.

Are there any new security requirements?
No new requirements, but internal security utilities have been strengthened. Ensure your Security.salt and Security.cipherSeed are set in core.php, as they have been for many versions.

Should I jump from 2.8 directly to CakePHP 3?
Not directly. Use 2.8 as a stepping stone to fix deprecations. Then, use the official migration guide and the migrations plugin to plan the move to 3.x, which involves more substantial changes like namespaces and ORM updates.

Releases In Branch 2.8

Version Release date
2.8.9 9 years ago
(September 19, 2016)
2.8.8 9 years ago
(September 15, 2016)
2.8.7 9 years ago
(September 10, 2016)
2.8.6 9 years ago
(August 03, 2016)
2.8.5 9 years ago
(June 13, 2016)
2.8.4 9 years ago
(May 03, 2016)
2.8.3 10 years ago
(March 29, 2016)
2.8.2 10 years ago
(March 14, 2016)
2.8.1 10 years ago
(February 28, 2016)
2.8.0 10 years ago
(February 07, 2016)
2.8.0-RC1 10 years ago
(January 13, 2016)