21 December 2020
CakePHP version 4.2.0 is now available.
What's New in CakePHP 4.2.0
- Full support for PHP8.
- Experimental support for a dependency injection container was added. The DI container enables you to have application dependencies injected into controller constructors, controller actions and command constructors.
- SQLServer driver now uses client-side buffers for results. This improves performance greatly.
- Cake\Http\Middleware\SessionCsrfProtectionMiddleware was added. Instead of storing CSRF tokens in a cookie, this middleware stores tokens in the session. This makes CSRF tokens user scoped and time based with the session, offering enhanced security over cookie based CSRF tokens.
- A new utility class Cake\Http\FlashMessage was added whose instance is available through ServerRequest::getFlash(). The class similar to the FlashComponent allows you to set flash messages from anywhere you have a request, making it useful in middleware.
- Table::subquery() and Query::subquery() were added. These methods lets you create query objects that don't have automatic aliasing.