Latest in branch 3.5
3.5.18
Released 24 Apr 2019
(7 years ago)
SoftwareCakePHP
Version3.5
Status
End of life
Supported
PHP versions
PHP 5.6-7.4
Initial release3.5.0
19 Aug 2017
(8 years ago)
Latest release3.5.18
24 Apr 2019
(7 years ago)
End of security fixesUnavailable
Release noteshttps://github.com/cakephp/cakephp/releases/tag/3.5.18
Source codehttps://github.com/cakephp/cakephp/tree/3.5.18
Documentationhttps://book.cakephp.org/3/en/index.html
Downloadhttps://book.cakephp.org/3/en/installation.html
CakePHP 3.5 ReleasesView full list

What Is New in CakePHP 3.5

CakePHP 3.5 introduces several new features, improvements, and deprecations to streamline development and modernize the framework's core. This release focuses on enhancing the ORM, improving request/response handling, and preparing for future versions. Below is a summary of the key changes.

Category Key Changes
New Features PSR-7 Support, MiddlewareStack, New ORM Finder Methods, Lazy Loading for Associations
Improvements Simplified Paginator, Better Testing Utilities, Enhanced Logging, Deprecation Warnings
Deprecations Controller Components, Helpers, and several methods in Request/Response objects.
Bug Fixes Various fixes across the ORM, View layer, and core libraries.

How does PSR-7 support change request handling?

CakePHP 3.5 adds experimental support for PSR-7 (psr/http-message), allowing you to work with standardized HTTP message interfaces. This is a foundational step for the middleware system. In practice, you can now type-hint Psr\Http\Message\ServerRequestInterface in controllers.

The existing Cake\Http\ServerRequest and Cake\Http\Response objects implement these interfaces, so your current code keeps working. This matters because it opens the door to using a wider ecosystem of PSR-7 compatible middleware.

MiddlewareStack

A new MiddlewareStack class provides a more structured way to apply middleware to your application. It replaces the older $middleware queue approach in Application. You now use addMiddleware() in your app's bootstrap() method.

// In src/Application.php
public function middleware($middleware)
{
    // Old 3.4 way - deprecated
    $middleware->add(new CustomMiddleware());
}

public function middleware($middlewareQueue)
{
    // New 3.5 way
    $middlewareQueue->addMiddleware(new CustomMiddleware());
}

What ORM finder methods were added?

The ORM gets new finder methods like find('list') and find('threaded') which can now be used directly on Table classes, not just Query objects. This makes code more concise and readable.

// Works in 3.5
$articles = $this->Articles->find('list');

// Instead of the longer 3.4 style
$articles = $this->Articles->find('list')->all();

Lazy Loading Associations

You can now lazy-load associations using the loadInto() method on entities. This is handy when you have an entity and need to fetch related data without rebuilding a query.

$article = $this->Articles->get($id);
$this->Articles->loadInto($article, ['Authors', 'Comments']);
// $article->author and $article->comments are now populated.

Which parts are deprecated in 3.5?

Several components are marked for removal in CakePHP 4.0. The deprecation warnings help you prepare your codebase. Major deprecations include the standalone use of Controller Components and Helpers.

Components and Helpers must now be defined as services in your controller's initialize() method using loadComponent() and loadHelper(). The old property declarations no longer work.

// Deprecated in 3.5
class ArticlesController extends AppController
{
    public $components = ['Flash'];
    public $helpers = ['Form'];
}

// Correct way in 3.5
class ArticlesController extends AppController
{
    public function initialize()
    {
        parent::initialize();
        $this->loadComponent('Flash');
        $this->loadHelper('Form');
    }
}

Methods in Cake\Http\ServerRequest and Cake\Http\Response related to array access (like offsetGet()) are also deprecated. Use the object's property or method equivalents instead.

How is pagination simplified?

The PaginatorComponent is simpler. The paginate() method now returns a ResultSetInterface directly, not a Query object. This means you don't need to call all() afterward.

// 3.5 - returns a ResultSet
$articles = $this->Paginator->paginate($query);

// 3.4 - returned a Query object
$articles = $this->Paginator->paginate($query)->all();

This change reduces boilerplate and aligns with how other finder methods work. The Controller::$paginate property and paginateModel option are deprecated in favor of passing all configuration to the paginate() method.

FAQ

Is PSR-7 support stable in 3.5?
It's marked as experimental. The interfaces are implemented, but the surrounding middleware ecosystem is still evolving. You can start using it, but be prepared for minor adjustments in future 3.x releases.

My app uses many $components and $helpers properties. What's the immediate risk?
Your app will work, but deprecation notices will appear in your logs. You should update to the new loadComponent() and loadHelper() style in initialize() to avoid breakage in 4.0.

Does lazy loading associations hurt performance?
It can if overused. It's perfect for loading data after the fact on a few entities. For large sets, stick to using contain() in your original query to avoid the N+1 query problem.

Why was the Paginator return value changed?
For consistency. Most other ORM methods return a result set. This change removes an extra step and makes the component's behavior more predictable.

Should I upgrade to 3.5 for a production app?
Yes, it's a stable release. Review the deprecation warnings in your logs after upgrading and plan to update deprecated code. The new features are additive and won't break well-formed 3.4 applications.

Releases In Branch 3.5

VersionRelease date
3.5.1824 Apr 2019
(7 years ago)
3.5.1721 May 2018
(8 years ago)
3.5.1627 Apr 2018
(8 years ago)
3.5.1514 Apr 2018
(8 years ago)
3.5.1420 Mar 2018
(8 years ago)
3.5.1304 Mar 2018
(8 years ago)
3.5.1211 Feb 2018
(8 years ago)
3.5.1121 Jan 2018
(8 years ago)
3.5.1029 Dec 2017
(8 years ago)
3.5.927 Dec 2017
(8 years ago)
3.5.812 Dec 2017
(8 years ago)
3.5.706 Dec 2017
(8 years ago)
3.5.618 Nov 2017
(8 years ago)
3.5.502 Nov 2017
(8 years ago)
3.5.416 Oct 2017
(8 years ago)
3.5.327 Sep 2017
(8 years ago)
3.5.212 Sep 2017
(8 years ago)
3.5.129 Aug 2017
(8 years ago)
3.5.019 Aug 2017
(8 years ago)
3.5.0-RC212 Aug 2017
(8 years ago)
3.5.0-RC127 Jul 2017
(8 years ago)