From 6ecaf413368498ca3d454826052117fd20648a6e Mon Sep 17 00:00:00 2001 From: Vladimir Grigor Date: Sun, 27 Jul 2014 22:53:49 +0300 Subject: [PATCH] removed unnecessary checks in Config --- Mage/Config.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Mage/Config.php b/Mage/Config.php index 68ce703..e7474d1 100644 --- a/Mage/Config.php +++ b/Mage/Config.php @@ -170,20 +170,17 @@ class Config { $environment = $this->getEnvironment(); - $configFilePath = getcwd() . '/.mage/config/environment/' . $environment . '.yml'; + if(!empty($environment)) + { + $configFilePath = getcwd() . '/.mage/config/environment/' . $environment . '.yml'; - $parameters = $this->getParameters(); + try { + $this->environmentConfig = $this->loadEnvironment($configFilePath); + } catch (ConfigNotFoundException $e) { + throw new RequiredConfigNotFoundException("Not found required config $configFilePath for environment $environment", 0 , $e); + } - if (empty($environment) && (!empty($parameters) || !$this->isRunInSpecialMode($parameters))) { - throw new RuntimeException('Environment is not set'); } - - try { - $this->environmentConfig = $this->loadEnvironment($configFilePath); - } catch (ConfigNotFoundException $e) { - throw new RequiredConfigNotFoundException("Not found required config $configFilePath for environment $environment", 0 , $e); - } - } /**