Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions en/appendices/5-0-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@ Cache
- The ``Wincache`` engine was removed. The wincache extension is not supported
on PHP 8.

Auth
----

- `Auth` has been removed. Use the `cakephp/authentication <https://book.cakephp.org/authentication/2/en/index.html>`__ and
`cakephp/authorization <https://book.cakephp.org/authorization/2/en/index.html>`__ plugins instead.

Console
-------

- ``ConsoleIntegrationTestTrait::useCommandRunner()`` was removed since it's no longer needed.
- ``Shell`` has been removed and should be replaced with `Command <https://book.cakephp.org/5/en/console-commands/commands.html>`__

Controller
----------
Expand All @@ -49,6 +56,11 @@ Controller
change can impact applications that use ``property_exists()`` on components.
- The components' ``Controller.shutdown`` event callback has been renamed from
``shutdown`` to ``afterFilter`` to match the controller one. This makes the callbacks more consistent.
- ``PaginatorComponent`` has been removed and should be replaced by calling ``$this->paginate()`` in your controller or
using ``Cake\Datasource\Paging\NumericPaginator`` directly
- ``RequestHandlerComponent`` has been removed. See the `4.4 migration <https://book.cakephp.org/4/en/appendices/4-4-migration-guide.html#requesthandlercomponent>`__ guide for how to upgrade
- ``SecurityComponent`` has been removed. Use ``FormProtectionComponent`` for form tampering protection
or ``HttpsEnforcerMiddleware`` to enforce use of HTTPS for requests instead.

Core
----
Expand All @@ -60,6 +72,7 @@ Core
- The ``App.uploadedFilesAsObjects`` configuration option has been removed
alongside of support for PHP file upload shaped arrays throughout the
framework.
- ``ClassLoader`` has been removed. Use composer to generate autoload files instead.

Database
--------
Expand All @@ -77,6 +90,8 @@ Database
CakePHP 4.x.
- ``SqlDialectTrait`` has been removed and all its functionality has been moved
into the ``Driver`` class itself.
- ``CaseExpression`` has been removed and should be replaced with
``QueryExpression::case()`` or ``CaseStatementExpression``

Datasource
----------
Expand All @@ -89,6 +104,14 @@ Event

- Event payloads must be an array. Other object such as ``ArrayAccess`` are no longer cast to array and will raise a ``TypeError`` now.

Error
-----

- ``ErrorHandler`` and ``ConsoleErrorHandler`` have been removed. See the `4.4 migration <https://book.cakephp.org/4/en/appendices/4-4-migration-guide.html#errorhandler-consoleerrorhandler>`__ guide for how to upgrade
- ``ExceptionRenderer`` has been removed and should be replaced with ``WebExceptionRenderer``
- ``ErrorLoggerInterface::log()`` has been removed and should be replaced with ``ErrorLoggerInterface::logException()``
- ``ErrorLoggerInterface::logMessage()`` has been removed and should be replaced with ``ErrorLoggerInterface::logError()``

Filesystem
----------

Expand All @@ -115,6 +138,11 @@ Log
- Log engine config now uses ``null`` instead of ``false`` to disable scopes.
So instead of ``'scopes' => false`` you need to use ``'scopes' => null`` in your log config.

Mailer
---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need more chars?


- ``Email`` has been removed. Use `Mailer <https://book.cakephp.org/5/en/core-libraries/email.html>`__ instead.

ORM
---

Expand All @@ -135,6 +163,14 @@ ORM
calling functions unrelated to the specific query type.
- ``Table::_initializeSchema()`` has been removed and should be replaced by calling
``$this->getSchema()`` inside the ``initialize()`` method.
- ``SaveOptionsBuilder`` has been removed. Use a normal array for options instead.

Routing
-------

- Static methods ``connect()``, ``prefix()``, ``scope()`` and ``plugin()`` of the ``Router`` have been removed and
should be replaced by calling their non-static method variants via the ``RouteBuilder`` instance.
- ``RedirectException`` has been removed. Use ``\Cake\Http\Exception\RedirectException`` instead.

TestSuite
---------
Expand Down