Load the environment if we need to or can.

@return array
969423
public function parse()
    {
        try {
            $this->ensureFileIsReadable();
        } catch (InvalidPathException $e) {
            return [];
        }

        $filePath = $this->filePath;
        $lines = $this->readLinesFromFile($filePath);

        $data = [];
        foreach ($lines as $line) {
            if (!$this->isComment($line) && $this->looksLikeSetter($line)) {
                list($name, $value) = $this->processFilters($line, null);
                $data[$name] = $value;
            }
        }

        return $data;
    }
292766
public static function getVars()
    {
        if (!is_array(static::$vars)) {
            $path = static::path("data/env.json");

            try {
                $vars = Json::decodeFromFile($path);
            } catch(\Exception $e) {
                $vars = [];
            }

            static::$vars = Helper::toArray($vars);
        }

        return static::$vars;
    }
302856
public static function environment()
	{
		$env = static::fw()->config->get( 'app.env', 'production' );

		if ( func_num_args() > 0 )
		{
			$patterns = is_array( func_get_arg( 0 ) ) ? func_get_arg( 0 ) : func_get_args();

			foreach ( $patterns as $pattern )
				if ( Str::is( $pattern, $env ) )
					return true;

			return false;
		}

		return $env;
	}
481710
private function loadApplication()
    {
        $app = require $this->module->config['bootstrap_file'];
        $app->loadEnvironmentFrom($this->module->config['environment_file']);
        $app->instance('request', new Request());

        return $app;
    }
970761
public function loadConfiguration()
    {
        if (empty($this->conf)) {
            $this->conf = $this->loadDefault();
        } else {
            $this->conf = array_merge(self::loadDefault(), $this->conf);
        }

        return $this->conf;
    }
1037359
public function load()
    {
        $items = [];
        $directory = new DirectoryIterator(realpath($this->directory));

        foreach ($directory as $file) {
            if ($file->isFile() && $file->getExtension() == $this->extension) {
                $filename = $file->getFilename();
                $config = substr($filename, 0, strrpos($filename, '.'));

                $items[$config] = $this->translateFile($file->getPathname());
            }
        }

        return $items;
    }
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();
        }
    }
121929
public function load()
    {
        $data = [];

        if (is_file($this->filePath)) {
            $data = json_decode(file_get_contents($this->filePath), true);
        }

        return $data;
    }
1272038
def load_environment_config():
    
    mapper = {
        'interface': 'CAN_INTERFACE',
        'channel': 'CAN_CHANNEL',
        'bitrate': 'CAN_BITRATE',
    }
    return dict(
        (key, os.environ.get(val))
        for key, val in mapper.items()
        if val in os.environ
    )
164428
protected function load()
    {
        $data = array();

        /** @var LoaderInterface $loader */
        foreach ($this->loaders as $loader) {
            try {
                $data = array_merge($data, $loader->load());

                if ($loader->stopPropagation()) {
                    break;
                }
            } catch (LoaderException $e) {
                $this->getLogger()->error($e->getMessage());
            }
        }

        return $data;
    }
310097
public function getEnvironment()
    {
        if ($this->environment == null) {
            $this->setEnvironment($this->getRevision()->getEnvironment());
        }
        return $this->environment;
    }
959795
public function run()
    {
        $current = [];
        if ($this->config['loadEnv']) {
            $current = $this->envLoader->parse();
        }

        foreach ($this->questions as $name => $question) {
            // If We got an answer out of the loaded env, then let's use it.
            $default = isset($current[$name]) ? $current[$name] : $question['default'];

            // Ask the question.
            $this->answers[$name] = $this->io->ask($name, $question['prompt'], $default, $question['required']);
        }

        return $this->answers;
    }
1078704
public function load()
    {
        if (! empty($this->resources)) {
            return $this->resources;
        }

        return $this->resources = $this->sanitizeResources(
            $this->getEnabledResources($this->loadResourceFiles())
        );
    }
787179
public function getEnvironments()
    {
        $project = $this->getProject();
        if (!$project) {
            return [];
        }

        return array_keys($this->api->getEnvironments($project, false, false));
    }
534319
public function getEnvironment()
	{
		$environment_file = $this->resolvePath('config/environment');
		
		if (file_exists($environment_file)) {
			$environment = trim(file_get_contents($environment_file));
		} else {
			$environment = 'local';
		}
		
		return $environment;
	}
951927
public function getConfiguration()
    {
        foreach ($this->mappings as $env => $callable) {
            $value = getenv($env);
            if ($value !== false) {
                $func = array_slice($callable, 0, 2);
                $args = array_slice($callable, 2);
                array_unshift($args, $value);
                call_user_func_array($func, $args);
            }
        }
        return $this->config;
    }
347407
protected function loadServiceData() {
    if (!isset($this->serviceData)) {
      $this->serviceData = $this->environment->getStorage()->retrieve('services');
    }

    // Populate the keys, in case analysis crashed.
    $this->serviceData += [
      'primary' => [],
      'all' => [],
    ];

    return $this->serviceData;
  }