Update Config

Once the upgrade tool is done and our environment is ready for upgrade, we need to update config files.

config/app.php (and also in config/app.php.default)

  • Enable deprecation warnings:
'Error' => [
    'errorLevel' => E_ALL,
]
  • Fix App.paths:
[
   'plugins' => [ROOT . DS . 'plugins' . DS],
   'templates' => [ROOT . DS . 'templates' . DS],
   'locales' => [RESOURCES . 'locales' . DS],
],
  • The default value of App.uploadedFilesAsObjects is now true. If your application uses file uploads you can set this flag to false for be compatible with the behavior in 3.x.
'App' => [
    // ...
    'uploadedFilesAsObjects' => false,
],

config/bootstrap.php and config/bootstrap_cli.php

config/paths.php

  • Define RESOURCES constant:
/**
 * Path to the resources directory.
 */
define('RESOURCES', ROOT . DS . 'resources' . DS);

Also note that some information included in this guide is also available in the CakePHP Book since we have prepared this document based on official docs and our experience through more than twenty upgrade jobs done.

Go to the next step (Composer)

NEED A CUSTOM SOLUTION?
GET IN TOUCH:

We Bake with CakePHP