1、开发时关闭cache,正式上线后打开cache
application config file (config/application.config.php
), disable this cache
remove config/development.config.php.dist
configuration file
或者使用composer development-enable 开启开发模式
$ composer development-enable # enable development mode
$ composer development-disable # disable development mode
$ composer development-status # whether or not development mode is enabled
生产运营时,关闭开发模式
set the display_not_found_reason and display_exceptions parameters to false
in production systems in module.config.php
2、autoload
新添加module时,编辑composer.json change
autoload
section;
using Composer's autoloading capabilities. As such, we need to inform Composer of our new namespace, and where its files live.
"autoload": { "psr-4": { "Application\": "module/Application/src/" } },
在Application module后面添加自己的module,添加完后执行composer dump-autoload
run the following to ensure Composer updates its autoloading rules:composer dump-autoload