Reload environment from given dotenv file

@param string $envPath Path to dotenv file
@option string $format Output format (table, list, csv, json, xml)
@option string $fields Limit output to given fields, comma-separated

@return PropertyList result
345807
public function projectDotenvReload($envPath = '.env', $opts = ['format' => 'table', 'fields' => ''])
    {
        // Reload
        $result = $this->taskDotenvReload()
            ->path($envPath)
            ->run();

        if (!$result->wasSuccessful()) {
            $this->exitError("Failed to run command");
        }

        return new PropertyList($result->getData());
    }
207071
public function finish($results)
    {
        if ($return = $this->saveFile($results))
        {
            $this->command->info('New .env file was saved.');

            /*
             * "Rebootstrap" Application to load new env variables to the config
             * using native Application::bootstrapWith([]) method with custom bootstrappers.
             *
             * First of all we have to make Dotenv mutable in order to overwrite environment variables.
             *
             * Next we have to update config.
             * In current Laravel implementation there is no method to reload Application config fully or Application itself.
             * Problem is that after reloading Config Repository it looses data from packages' config files
             * that are not currently published in /config directory. They are loaded only once after Application is bootstrapped.
             * And you can't force it to "rebootstrap" fully manually from outside (protected methods/properties).
             *
             * So the only way to "rebootstrap" it partly with custom Bootstrapper that uses existing Config Repository to
             * reload all /config files.
             */
            $this->command->getLaravel()->bootstrapWith($this->boostrappers);
        }
        else
        {
            $this->command->error('Failed to save .env file. Check permissions please.');
        }

        return $return;
    }
494739
public function getDataByEnv($siteEnv) 
	{
	    $select = $this->tableGateway->getSql()->select();
	     
	    $select->columns(array('*'));
	    $select->group('melis_cms_site_domain.sdom_env');
	    $select->where(array('sdom_env' => $siteEnv));
	    $resultSet = $this->tableGateway->selectWith($select);
	     
	    return $resultSet;
	}
133057
public function load($path, $file = '.env')
    {
        try {
            $env = new \Dotenv\Dotenv($path, $file);
            $env->load();

            return true;
        } catch (\Dotenv\Exception\InvalidPathException $e) {
            return false;
        }
    }
531752
protected function loadEnv()
    {
        if (defined('ENV_DIR') && file_exists(ENV_DIR)) {
            if (defined('ENV_FILE') && file_exists(ENV_FILE)) {
                $dotenv = new \Dotenv\Dotenv(ENV_DIR, ENV_FILE);
            } else {
                $dotenv = new \Dotenv\Dotenv(ENV_DIR);
            }
            $dotenv->load();
        }
    }
654613
protected function parseEnv(
        array $envs,
        /*# string */ $path,
        /*# bool */ $overload
    )/*# : array */ {
        foreach ($envs as $key => $val) {
            // source another env file
            if ($this->source_marker === $val) {
                $src = $this->expandPath($this->deReference($key), $path);
                $this->load($src, $overload);

            // set env
            } else {
                $this->setEnv($key, $this->deReference($val), $overload);
            }
        }
        return $this;
    }
1162313
function createEnvironment()
    {
        $env = new Environment;

        $loadPaths = $this->loadPaths ?: array();

        foreach ($loadPaths as $path) {
            $env->appendPath(dirname($this->filename) . "/" . $path);
        }

        if (!$this->debug) {
            if ($jsCompressor = $this->jsCompressor) {
                $env->setJsCompressor($jsCompressor);
            }

            if ($cssCompressor = $this->cssCompressor) {
                $env->setCssCompressor($cssCompressor);
            }
        }

        return $env;
    }
1334355
public static function load($path)
    {
        if (is_dir($path)) {
            foreach (preg_grep('/^\.env$/', scandir($path)) as $filename) {
                $filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $filename;
                if (is_readable($filePath)) {
                    foreach (parse_ini_file($filePath) as $envKey => $envValue) {
                        putenv($envKey . '=' . $envValue);
                    }
                }
            }
        } else {
            throw new BaseException('Your path does not directory.');
        }
    }
845543
public static function getEnvPath() : string
    {
        // check for unix and windows case $_SERVER index
        foreach (['PATH', 'Path', 'path'] as $index) {
            if (isset($_SERVER[$index])) {
                return $_SERVER[$index];
            }
        }
        throw new RuntimeException('cant find local PATH variable');
    }
1296366
protected function createJavascriptsElement(string $path, ?string $format) : string {
        return sprintf($format ?: '<script src="%s"></script>', $this->buildAssetUrl($path));
    }
546896
private function load($env = 'local', $file = 'config')
    {
        $path = BASE_PATH . ($file === '.env' ? '' : '/config');

        // File paths
        $configPath = "{$path}/{$file}.yml";
        $envConfigPath = "{$path}/{$file}_{$env}.yml";

        if (!file_exists($configPath)) {
            throw new \Exception("Config file not found at \"{$configPath}\".");
        }

        $data = file_get_contents($configPath);

        if ($data === false) {
            throw new \Exception("Unable to load configuration from: {$configPath}");
        }

        $yaml = new Parser();

        // Load config
        $config = $yaml->parse($data);
        $this->config = $config ? $config : [];

        // Load environment specific config
        if (file_exists($envConfigPath)) {
            $data = file_get_contents($envConfigPath);

            if ($data) {
                $config = $yaml->parse($data);
                $config = $config ? $config : [];

                // Merge config values
                $this->config = array_merge($this->config, $config);
            }
        }
    }
149832
public function dump(\Twig_Environment $env, $value)
    {
        $cloner = new VarCloner();

        $dump = fopen('php://memory', 'r+b');
        $dumper = new HtmlDumper($dump, $env->getCharset());

        $dumper->dump($cloner->cloneVar($value));
        rewind($dump);

        return stream_get_contents($dump);
    }
187500
public function dump(Twig_Environment $env, $context)
    {
        $output = '';

        $count = func_num_args();
        if (2 === $count) {
            $data = [];
            foreach ($context as $key => $value) {
                if (is_object($value)) {
                    if (method_exists($value, 'toArray')) {
                        $data[$key] = $value->toArray();
                    } else {
                        $data[$key] = 'Object (' . get_class($value) . ')';
                    }
                } else {
                    $data[$key] = $value;
                }
            }
            $output .= $this->formatter->formatVar($data);
        } else {
            for ($i = 2; $i < $count; $i++) {
                $output .= $this->formatter->formatVar(func_get_arg($i));
            }
        }

        return '<pre>' . $output . '</pre>';
    }
1163779
function loadEnv(name) {
    var fullEnvPath = path.resolve(applicationRoot, './configs/' + name);
    try {
      debug('Loaded environment: ' + fullEnvPath);
      fs.statSync(fullEnvPath);
      dotenv.config({ path: fullEnvPath });
    }
    catch (e) {
      debug('Could not load environment "' + fullEnvPath + '"');
    }
  }
608329
public String resolveLastaEnvPath(String envPath) {
        if (envPath == null) {
            throw new IllegalArgumentException("The argument 'envPath' should not be null.");
        }
        final String lastaEnv = getLastaEnv();
        if (lastaEnv != null && envPath.contains("_env.")) { // e.g. maihama_env.properties to maihama_env_prod.properties
            final String front = LdiSrl.substringLastFront(envPath, "_env.");
            final String rear = LdiSrl.substringLastRear(envPath, "_env.");
            return front + "_env_" + lastaEnv + "." + rear;
        } else {
            return envPath;
        }
    }
951724
public function fields($fields, $path = null)
    {
        if (is_null($fields)) return;

        $path = $path ?: __DIR__.'/../tmp-fields.txt';
        $fields = preg_split('/, ?/', $fields);
        $arrayFields = array();

        foreach($fields as $pair)
        {
            list($key, $val) = preg_split('/ ?: ?/', $pair);
            $arrayFields[$key] = $val;
        }

        return $this->file->put($path, json_encode($arrayFields));
    }
142177
public function load(array $required = null):DotEnv{
		return $this->loadEnv($this->path, $this->filename, true, $required, $this->global);
	}