Вход Регистрация
Файл: concrete5.7.5.6/concrete/vendor/illuminate/config/Illuminate/Config/EnvironmentVariables.php
Строк: 64
<?php namespace IlluminateConfig;

/**
 * PHP $_ENV loader for protecting sensitive configuration options.
 *
 * Inspired by the wonderful "Dotenv" library by Vance Lucas.
 */
class EnvironmentVariables {

    
/**
     * The environment loader implementation.
     *
     * @var IlluminateConfigEnvironmentLoaderInterface  $loader
     */
    
protected $loader;

    
/**
     * The server environment instance.
     *
     * @param  IlluminateConfigEnvironmentLoaderInterface  $loader
     * @return void
     */
    
public function __construct(EnvironmentVariablesLoaderInterface $loader)
    {
        
$this->loader $loader;
    }

    
/**
     * Load the server variables for a given environment.
     *
     * @param  string  $environment
     */
    
public function load($environment null)
    {
        foreach (
$this->loader->load($environment) as $key => $value)
        {
            
$_ENV[$key] = $value;

            
$_SERVER[$key] = $value;

            
putenv("{$key}={$value}");
        }
    }

}
Онлайн: 1
Реклама