diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php index 800c1c9e33f9a..a121f483bda2b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php @@ -107,7 +107,7 @@ private static function getPhpUnitCliConfigArgument() protected static function getKernelClass() { if (isset($_SERVER['KERNEL_CLASS']) || isset($_ENV['KERNEL_CLASS'])) { - $class = isset($_SERVER['KERNEL_CLASS']) ? $_SERVER['KERNEL_CLASS'] : $_ENV['KERNEL_CLASS']; + $class = isset($_ENV['KERNEL_CLASS']) ? $_ENV['KERNEL_CLASS'] : $_SERVER['KERNEL_CLASS']; if (!class_exists($class)) { throw new \RuntimeException(sprintf('Class "%s" doesn\'t exist or cannot be autoloaded. Check that the KERNEL_CLASS value in phpunit.xml matches the fully-qualified class name of your Kernel or override the %s::createKernel() method.', $class, static::class)); } @@ -116,7 +116,7 @@ protected static function getKernelClass() } if (isset($_SERVER['KERNEL_DIR']) || isset($_ENV['KERNEL_DIR'])) { - $dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : $_ENV['KERNEL_DIR']; + $dir = isset($_ENV['KERNEL_DIR']) ? $_ENV['KERNEL_DIR'] : $_SERVER['KERNEL_DIR']; if (!is_dir($dir)) { $phpUnitDir = static::getPhpUnitXmlDir(); @@ -176,20 +176,20 @@ protected static function createKernel(array $options = array()) if (isset($options['environment'])) { $env = $options['environment']; - } elseif (isset($_SERVER['APP_ENV'])) { - $env = $_SERVER['APP_ENV']; } elseif (isset($_ENV['APP_ENV'])) { $env = $_ENV['APP_ENV']; + } elseif (isset($_SERVER['APP_ENV'])) { + $env = $_SERVER['APP_ENV']; } else { $env = 'test'; } if (isset($options['debug'])) { $debug = $options['debug']; - } elseif (isset($_SERVER['APP_DEBUG'])) { - $debug = $_SERVER['APP_DEBUG']; } elseif (isset($_ENV['APP_DEBUG'])) { $debug = $_ENV['APP_DEBUG']; + } elseif (isset($_SERVER['APP_DEBUG'])) { + $debug = $_SERVER['APP_DEBUG']; } else { $debug = true; } diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php index 703b57b574b7f..ffe162c74fe32 100644 --- a/src/Symfony/Component/DependencyInjection/Container.php +++ b/src/Symfony/Component/DependencyInjection/Container.php @@ -432,12 +432,12 @@ protected function getEnv($name) if (isset($this->envCache[$name]) || array_key_exists($name, $this->envCache)) { return $this->envCache[$name]; } - if (isset($_SERVER[$name]) && 0 !== strpos($name, 'HTTP_')) { - return $this->envCache[$name] = $_SERVER[$name]; - } if (isset($_ENV[$name])) { return $this->envCache[$name] = $_ENV[$name]; } + if (isset($_SERVER[$name]) && 0 !== strpos($name, 'HTTP_')) { + return $this->envCache[$name] = $_SERVER[$name]; + } if (false !== ($env = getenv($name)) && null !== $env) { // null is a possible value because of thread safety issues return $this->envCache[$name] = $env; }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: