简体   繁体   中英

cakephp upgrade 2.xx to 3.x

Deprecated: PHP configuration files like "app.php" should not set $config . Instead return an array. - C:\\composer\\upgrade\\vendor\\cakephp\\cakephp\\src\\Core\\Configure.php, line: 343
You can disable deprecation warnings by setting Error.errorLevel to E_ALL & ~E_USER_DEPRECATED in your config/app.php. in C:\\composer\\upgrade\\vendor\\cakephp\\cakephp\\src\\Core\\functions.php on line 311
Exception: If config is null, key must be an array. in [C:\\composer\\upgrade\\vendor\\cakephp\\cakephp\\src\\Core\\StaticConfigTrait.php, line 79]

I just follow the tools. How to remove the error?

Very simply, as the error message indicates, you need to return an array instead of setting $config . Change

$config = [

to

return [

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM