Load a config file into the current instance.

@param string $path The config file to load.
@param string $prefix The string to prefix all targets in $path with.
@return $this
5308
public function load($path, $prefix = '')
    {
        $config = $this->readConfig($path);

        foreach ($config as $section => $values) {
            if (in_array($section, self::$_extensionTypes)) {
                // extension section, merge in the defaults.
                $defaults = $this->get($section);
                if ($defaults) {
                    $values = array_merge($defaults, $values);
                }
                $this->addExtension($section, $values);
            } elseif (strtolower($section) === self::GENERAL) {
                if (!empty($values['timestampPath'])) {
                    $path = $this->_replacePathConstants($values['timestampPath']);
                    $values['timestampPath'] = rtrim($path, '/') . '/';
                }
                $this->set(self::GENERAL, $values);
            } elseif (strpos($section, self::FILTER_PREFIX) === 0) {
                // filter section.
                $name = str_replace(self::FILTER_PREFIX, '', $section);
                $this->filterConfig($name, $values);
            } else {
                $lastDot = strrpos($section, '.') + 1;
                $extension = substr($section, $lastDot);
                $key = $section;

                // must be a build target.
                $this->addTarget($prefix . $key, $values);
            }
        }

        $this->resolveExtends();

        return $this;
    }
1011264
public function configDir(string $path): self
    {
        $this->validatePathIsRelativeToProject($path, __METHOD__);
        $this->configDir = rtrim($path, '/');

        return $this;
    }
806002
public function cacheDir(string $path): self
    {
        $this->validatePathIsRelativeToProject($path, __METHOD__);
        $this->cacheDir = rtrim($path, '/');

        return $this;
    }
1142063
private function loadDirectory($path)
    {
        $directory = new RecursiveDirectoryIterator($path);
        $iterator = new RecursiveIteratorIterator($directory);
        $files = new RegexIterator($iterator, '/^[^\.](?:(?!\/\.).)+?\.php$/i');

        $fm = $this;

        foreach ($files as $file) {
            require $file->getPathName();
        }
    }
342742
public function load($path)
    {
        $path = $this->findAbsolutePath($path);

        if ($this->cache) {
            if ($this->cache->isFresh($path, filemtime($path))) {
                $feature = $this->cache->read($path);
            } elseif (null !== $feature = $this->parseFeature($path)) {
                $this->cache->write($path, $feature);
            }
        } else {
            $feature = $this->parseFeature($path);
        }

        return null !== $feature ? array($feature) : array();
    }
35644
public function removePrefixPath($prefix, $path = null)
    {
        $this->_loader->removePrefixPath($prefix, $path);

        return $this;
    }
77025
public function load(string $path): ThemeManager
    {
        $this->setThemeDirectory();
        $this->setThemeConstants();
        $this->loadThemeConfiguration($path);
        $this->setThemeAutoloading();

        return $this;
    }
1115205
public static function loadArray(array $array,$prefix_path=null){
    $array = static::filterWith(["load.array", "load"], $array);
    if ($prefix_path){
      static::set($prefix_path,$array);
    } else {
      static::merge($array);
    }
    self::trigger('loaded');
  }
906343
public function loadAll($prefix = '')
		{

			// Loop through files
			foreach ($this->_files as $section => $file) {

				// Load it?
				if (strlen($prefix) == 0 || 
					$prefix == $section ||
					(strlen($section) > strlen($prefix) && substr($section, 0, strlen($prefix)) == $prefix) ||
					(strlen($section) < strlen($prefix) && substr($prefix, 0, strlen($section)) == $section)) {
				
					// Load file
					$this->_loadFile($file);

					// Remove from queue
					unset($this->_files[$section]);

				}

			}

		}
205786
public function loadImage(string $path): self
    {
        $this->image = new Image($this->secret, $path, null, $this->autorotate);
        return $this;
    }
1203013
public function loadTemplate($path)
    {
        $tpl = new Template();

        $tpl->injectVariables($this->getVariables());
        $tpl->setViewName($path);
        $tpl->setConfig("allow_debug", $this->getConfig("allow_debug"));
        $tpl->setConfig("layout", $this->getConfig("layout"));

        return $tpl->compile();
    }
695146
public static function registerPrefix($prefix, $path, $reset = false, $prepend = false)
    {
        $addPath = function () use ($prefix, $path, $reset, $prepend) {
            foreach ([
                         LoaderFactory::LIBRARIES_LEGACY,
                         LoaderFactory::LIBRARIES_JOOMLA,
                         LoaderFactory::LIBRARIES_CMS
                     ] as $overridePathPart) {
                if (preg_match('/' . preg_quote($overridePathPart, '/') . '$/', $path)) {
                    foreach (array_reverse(self::$instance->overridePaths) as $overridePath) {
                        $path = $overridePath . DIRECTORY_SEPARATOR . $overridePathPart;
                        if (is_dir($path)) {
                            parent::registerPrefix($prefix, $path, $reset, $prepend);
                        }
                    }
                    break;
                }
            }
        };

        if (!$prepend) {
            $addPath();
        }

        parent::registerPrefix($prefix, $path, $reset, $prepend);

        if ($prepend) {
            $addPath();
        }
    }
1189963
public function loadEnv(string $path): Configurator
    {
        if (is_readable($path)) {
            $this->dotEnv->load($path);
        }

        return $this;
    }
1044459
protected function loadFile($path)
    {
        if (pathinfo($path, PATHINFO_EXTENSION) !== 'php') {
            throw new \InvalidArgumentException('Can only parse files with ".php" extensions');
        }
        if (!file_exists($path)) {
            throw new \InvalidArgumentException(sprintf('Failed to find \'%s\' file.', $path));
        }

        return file_get_contents($path);
    }
888117
public function load($config) {
		if ($this->configsDir === null) {
			new Exceptions\ConfiguratorError('Directory of configuration files did not been set');
		}
		
		$file = $this->configsDir->getFile($config);
		
		$this->addConfigReader($this->initReader($file));
		
		return $this;
	}
829548
public function loadFile($path) {
        $config = null;
        $mode = defined('INI_SCANNER_TYPED') ? INI_SCANNER_TYPED : INI_SCANNER_NORMAL;

        try {
            $config = parse_ini_file($path, true, $mode);
        } catch (Exception $ex) {}

        if ( ! is_array($config)) {
            throw new InvalidConfigFormatException(
                s('IniConfigDriver expects config at path %s to be a valid ini file.', $path)
            );
        }

        return $config;
    }
670015
public function addPrefixPath($prefix, $path)
    {
        if (!is_string($prefix) || !is_string($path)) {

            throw new Zend_Loader_PluginLoader_Exception('Zend_Loader_PluginLoader::addPrefixPath() method only takes strings for prefix and path.');
        }

        $prefix = $this->_formatPrefix($prefix);
        $path   = rtrim($path, '/\\') . '/';

        if ($this->_useStaticRegistry) {
            self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix][] = $path;
        } else {
            if (!isset($this->_prefixToPaths[$prefix])) {
                $this->_prefixToPaths[$prefix] = array();
            }
            if (!in_array($path, $this->_prefixToPaths[$prefix])) {
                $this->_prefixToPaths[$prefix][] = $path;
            }
        }
        return $this;
    }