Yii框架的config / main.php文件可以通过array_merge被local.php配置文件覆盖 。 这允许我设置不同的数据库连接和特定于生产,QA和开发环境的其他参数。
Yii还允许我在命令行中运行命令 。 它使用config / console.php文件。 有没有办法设置本地控制台配置文件的方式与覆盖主控制台配置的方式相同,具体取决于环境?
Yii framework's config/main.php file can be overwritten by a local.php configuration file via an array_merge. This allows me to set different database connections and other parameters specific to production, QA, and development environments.
Yii also allows me to run commands in the command line. It uses a config/console.php file. Is there a way I can set up a local console config file in the same way that will override the main console config depending on the environment?
最满意答案
嗯,这是一个有趣的方式来覆盖配置。 但看起来您可以像修改main.php一样修改console.php(将local_config函数添加到console.php并将其指向console-local.php)。
Hmm, that's an interesting way of doing overriding the config. But it looks like you could just modify console.php in the same way you did the main.php (add local_config function to console.php and point it to console-local.php).
更多推荐
发布评论