From fc1f39c6bce6c6709215299cc6cb49b0bcd01e91 Mon Sep 17 00:00:00 2001 From: watura Date: Tue, 17 Dec 2019 17:14:15 +0900 Subject: [PATCH 1/4] feat: application.local.yml replaces application.yml --- Config/bootstrap.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Config/bootstrap.php b/Config/bootstrap.php index 532436e5..0e4f7ddd 100644 --- a/Config/bootstrap.php +++ b/Config/bootstrap.php @@ -27,13 +27,13 @@ // Load application configurations $conf = array(); -$files = array('application.yml', 'application.local.yml'); +$files = array('application.yml', 'application.local.yml', env('HTTP_HOST') . '.yml', env('HTTP_X_FORWARDED_HOST') . '.yml'); foreach ($files as $file) { - if (file_exists(APP . 'Config' . DS . $file)) { - $conf = array_merge($conf, Spyc::YAMLLoad(APP . 'Config' . DS . $file)); - Configure::write($conf); - } + if (file_exists(APP . 'Config' . DS . $file)) { + $conf = array_replace_recursive($conf, Spyc::YAMLLoad(APP . 'Config' . DS . $file)); + } } +Configure::write($conf); // Load all plugins $plugins = App::objects('plugins'); From fcc8b1ca87b295768efc75ca21f213451315b55f Mon Sep 17 00:00:00 2001 From: Wataru Nishimoto Date: Thu, 19 Dec 2019 09:53:46 +0900 Subject: [PATCH 2/4] feat: add prefix for application..yml Co-Authored-By: Sakamoto, Kazunori --- Config/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/bootstrap.php b/Config/bootstrap.php index 0e4f7ddd..afe272d4 100644 --- a/Config/bootstrap.php +++ b/Config/bootstrap.php @@ -27,7 +27,7 @@ // Load application configurations $conf = array(); -$files = array('application.yml', 'application.local.yml', env('HTTP_HOST') . '.yml', env('HTTP_X_FORWARDED_HOST') . '.yml'); +$files = array('application.yml', 'application.local.yml', 'application.' . env('HTTP_HOST') . '.yml', 'application.' . env('HTTP_X_FORWARDED_HOST') . '.yml'); foreach ($files as $file) { if (file_exists(APP . 'Config' . DS . $file)) { $conf = array_replace_recursive($conf, Spyc::YAMLLoad(APP . 'Config' . DS . $file)); From 733944fc882bc3c0c6b67477faf9545ce2243012 Mon Sep 17 00:00:00 2001 From: watura Date: Thu, 19 Dec 2019 10:01:05 +0900 Subject: [PATCH 3/4] style: use tab --- Config/bootstrap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Config/bootstrap.php b/Config/bootstrap.php index afe272d4..cc3babab 100644 --- a/Config/bootstrap.php +++ b/Config/bootstrap.php @@ -29,9 +29,9 @@ $conf = array(); $files = array('application.yml', 'application.local.yml', 'application.' . env('HTTP_HOST') . '.yml', 'application.' . env('HTTP_X_FORWARDED_HOST') . '.yml'); foreach ($files as $file) { - if (file_exists(APP . 'Config' . DS . $file)) { - $conf = array_replace_recursive($conf, Spyc::YAMLLoad(APP . 'Config' . DS . $file)); - } + if (file_exists(APP . 'Config' . DS . $file)) { + $conf = array_replace_recursive($conf, Spyc::YAMLLoad(APP . 'Config' . DS . $file)); + } } Configure::write($conf); From e98ee21c3f500a777dfdba1398592d918c87b78d Mon Sep 17 00:00:00 2001 From: watura Date: Mon, 23 Dec 2019 08:40:15 +0900 Subject: [PATCH 4/4] style: fix 'line exceeds maximum limit' --- Config/bootstrap.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Config/bootstrap.php b/Config/bootstrap.php index cc3babab..f6d6f8ba 100644 --- a/Config/bootstrap.php +++ b/Config/bootstrap.php @@ -27,7 +27,10 @@ // Load application configurations $conf = array(); -$files = array('application.yml', 'application.local.yml', 'application.' . env('HTTP_HOST') . '.yml', 'application.' . env('HTTP_X_FORWARDED_HOST') . '.yml'); +$files = array('application.yml', + 'application.local.yml', + 'application.' . env('HTTP_HOST') . '.yml', + 'application.' . env('HTTP_X_FORWARDED_HOST') . '.yml'); foreach ($files as $file) { if (file_exists(APP . 'Config' . DS . $file)) { $conf = array_replace_recursive($conf, Spyc::YAMLLoad(APP . 'Config' . DS . $file));