Skip to content

Latest commit

 

History

History
150 lines (104 loc) · 4.71 KB

upgrade_450.rst

File metadata and controls

150 lines (104 loc) · 4.71 KB

Upgrading from 4.4.x to 4.5.0

Please refer to the upgrade instructions corresponding to your installation method.

A bug that prevented options passed to outer group() from being merged with options in inner group() has been fixed.

Check and correct your route configuration as it could change the values of the options applied.

For example,

$routes->group('admin', ['filter' => 'csrf'], static function ($routes) {
    $routes->get('/', static function () {
        // ...
    });

    $routes->group('users', ['namespace' => 'Users'], static function ($routes) {
        $routes->get('/', static function () {
            // ...
        });
    });
});

Now the csrf filter is executed for both the route admin and admin/users. In previous versions, it is executed only for the route admin. See also :ref:`routing-nesting-groups`.

Some method signature changes have been made. Classes that extend them should update their APIs to reflect the changes. See :ref:`ChangeLog <v450-method-signature-changes>` for details.

The order in which Controller Filters are executed has changed. If you wish to maintain the same execution order as in previous versions, set true to Config\Feature::$oldFilterOrder. See also :ref:`filter-execution-order`.

  1. The order of execution of filter groups has been changed.

    Before Filters:

    Previous: route → globals → methods → filters
         Now: globals → methods → filters → route
    

    After Filters:

    Previous: route → globals → filters
         Now: route → filters → globals
    

2. The After Filters in Route filters and Filters filters execution order is now reversed.

When you have the following configuration:

// In app/Config/Routes.php
$routes->get('/', 'Home::index', ['filter' => ['route1', 'route2']]);

// In app/Config/Filters.php
public array $filters = [
    'filter1' => ['before' => '*', 'after' => '*'],
    'filter2' => ['before' => '*', 'after' => '*'],
];

Before Filters:

Previous: route1 → route2 → filter1 → filter2
     Now: filter1 → filter2 → route1 → route2

After Filters:

Previous: route1 → route2 → filter1 → filter2
     Now: route2 → route1 → filter2 → filter1

Some deprecated items have been removed. If you extend these classes and are using them, upgrade your code. See :ref:`ChangeLog <v450-removed-deprecated-items>` for details.

Some files in the project space (root, app, public, writable) received updates. Due to these files being outside of the system scope they will not be changed without your intervention.

There are some third-party CodeIgniter modules available to assist with merging changes to the project space: Explore on Packagist.

The following files received significant changes (including deprecations or visual adjustments) and it is recommended that you merge the updated versions with your application:

Config

  • app/Config/Database.php
    • The default value of charset in $default has been change to utf8mb4.
    • The default value of DBCollat in $default has been change to utf8mb4_general_ci.
    • The default value of DBCollat in $tests has been change to ''.
  • app/Config/Feature.php
  • app/Config/Kint.php

This is a list of all files in the project space that received changes; many will be simple comments or formatting that have no effect on the runtime:

  • @TODO