Load local config file from plugins directory.
The loaded values are patched over the global configuration.

@param string $fname Config file name relative to the plugin's folder

@return boolean True on success, false on failure
775155
public function load_config($fname = 'config.inc.php')
    {
        if (in_array($fname, $this->loaded_config)) {
            return true;
        }

        $this->loaded_config[] = $fname;

        $fpath = $this->home.'/'.$fname;
        $rcube = rcube::get_instance();

        if (($is_local = is_file($fpath)) && !$rcube->config->load_from_file($fpath)) {
            rcube::raise_error(array(
                'code' => 527, 'type' => 'php',
                'file' => __FILE__, 'line' => __LINE__,
                'message' => "Failed to load config from $fpath"), true, false);
            return false;
        }
        else if (!$is_local) {
            // Search plugin_name.inc.php file in any configured path
            return $rcube->config->load_from_file($this->ID . '.inc.php');
        }

        return true;
    }
731097
public function load(string $filename)
  {
    # Attempt to load config file
    if ( \file_exists($filename) ) {
      # Set filename
      $this->filename = $filename;

      # Load the config
      $configArray = \json_decode( \file_get_contents($filename), true);

      if ($configArray) {
        // $configArray = $this->array_change_key_case_recursive($configArray); // Lowercase the keys
        # Merge the Config with existing config
        // $this->confValues = \array_replace_recursive($this->confValues, $configArray);
        $this->confValues = $configArray;
      } else {
        throw new SpinException('Invalid JSON file "'.$filename.'"');

      }
    }

    return $this;
  }
1111329
public function prepareEnvironment($fname)
    {
        GeneralUtility::mkdir_deep(PATH_site.'typo3temp/', 'DynCss/');
        if (!is_dir(PATH_site.$this->cachePath)) {
            throw new \Exception('Can´t create cache directory PATH_site/'.$this->cachePath);
        }
        if (!is_file($fname)) {
            return false;
        }

        return true;
    }
430693
protected function loadTokenFromFile($filename)
    {
        if (strpos($filename, '/') !== 0 && strpos($filename, '\\') !== 0) {
            $filename = $this->config->getUserConfigDir() . '/' . $filename;
        }

        $content = file_get_contents($filename);
        if ($content === false) {
            throw new \RuntimeException('Failed to read file: ' . $filename);
        }

        return trim($content);
    }
6557
public static function load(string $filename) {
		if(class_exists(Dotenv::class)) {
			$dotenv = new Dotenv($filename);
			$dotenv->load();
		}
	}
1300195
public static function loadFromScript(string $filename): ?Config
    {
        if (
            (function_exists('opcache_is_script_cached') && opcache_is_script_cached($filename)) ||
            file_exists($filename)
        ) {
            return include $filename ?: null;
        }

        return null;
    }
466020
protected function loadConfiguration($configuration)
    {
        if (! $this->wasGivenAConfigurationPath()) {
            return $this->includeConfiguration($configuration);
        }

        $files = array_filter(['c', 'configuration'], [$this, 'optionIsFile']);

        if (empty($files)) {
            return false;
        }

        return $this->includeConfiguration($this->options[array_pop($files)]);
    }
1158804
public function loadFile($filename) {
		$this->filename = $filename;


		// If a cache directory was specified,
        // try to load from it
		if ($this->cachePath) {
		    if (! $this->templatesRoot) {
		        $this->templatesRoot = dirname($filename);
            }
		    $cacheFile = $this->makeCacheFilename($this->cachePath, $this->templatesRoot, $this->filename);
            if ( file_exists($cacheFile)
                 && (! file_exists($this->filename) || (filemtime($this->filename) < filemtime($cacheFile)) )
            ) {
                $this->loadFromSerialized(file_get_contents($cacheFile));
                return;
            }
        }

		if(file_exists($filename)) {
			$this->source = file_get_contents($filename);
		} else {
			$message = "File not found: $filename";
			throw new FileNotFoundException($message, $filename);
		}
	}
40797
function set_conf( $confname ){
		$this->confname = $confname;
		$this->confdir = PLUG_HOST_DIR.'/'.$confname;
		if( ! PLUGTool::check_dir($this->confdir) ){
			throw new PLUGException('bad conf');
		}
		// parse default plug conf using external parser
		$confpath = $this->confdir.'/PLUG.conf.php';
		$this->conf_vars = array();
		$this->conf_consts = array ();
		$this->load_conf( $confpath );
	}
232884
public static function loadRuntimeInfo($fileName)
    {
        if(!is_file($fileName))
        {
            return false;
        }
        static::$runtimeInfo = unserialize(file_get_contents($fileName));
        $data = static::$runtimeInfo->annotationParserData;
        Annotation::getInstance()->getParser()->setData($data[0]);
        Annotation::getInstance()->getParser()->setFileMap($data[1]);
        Annotation::getInstance()->getParser()->setParsers(static::$runtimeInfo->annotationParserParsers);
        AnnotationManager::setAnnotations(static::$runtimeInfo->annotationManagerAnnotations);
        AnnotationManager::setAnnotationRelation(static::$runtimeInfo->annotationManagerAnnotationRelation);
        foreach(static::$runtimeInfo->parsersData as $parserClass => $data)
        {
            $parser = $parserClass::getInstance();
            $parser->setData($data);
        }
        return true;
    }
570621
protected function loadClass($className)
    {
        if (strpos($className, NS) !== false) {
            $className = str_replace(NS, DS, ltrim($className, NS));
        }

        $filename = str_replace('_', DS, $className) . '.php';

        if (array_key_exists($className, $this->includePaths)) {
            @require_once $this->includePaths[$className];

            if (class_exists('\\' . trim("$className", '\\'))) {
                return true;
            }
        }

        foreach ($this->includePaths as $namespace => $includePath) {
            if (file_exists($includePath . $filename)) {
                require_once $includePath . $filename;

                return true;
            }
        }

        return false;
    }
133677
public function loadConfig($name)
    {
        // only if config not yet exists
        if (!$this->configExists($name))
            $this->config[$name] = $this->getConfigObjectFromDatabase($name);
    }
744950
public static function load( $fileName )
	{
		if( !file_exists( $fileName ) )
			throw new Exception( 'File "'.$fileName.'" is not existing.' );

		$reader	= new FS_File_Reader( $fileName );
		$lines	= $reader->readArray();
		
		$list	= array();
		foreach( $lines as $line )
		{
			$line = trim( $line );
			if( !$line )
				continue;
			if( preg_match( self::$commentPattern, $line ) )
				continue;
					
			if( preg_match( self::$sectionPattern, $line ) )
			{
				$section = substr( $line, 1, -1 );
				if( !isset( $list[$section] ) )
					$list[$section]	= array();
			}
			else if( $section )
				$list[$section][]	= $line;
		}
		return $list;
	}
1121423
protected function loadCompiledFile($filename)
    {
        if (!file_exists($filename)) {
            return false;
        }

        $cache = include $filename;
        if (
            !\is_array($cache)
            || !isset($cache['checksum'], $cache['data'], $cache['@class'])
            || $cache['@class'] !== \get_class($this)
        ) {
            return false;
        }

        // Load real file if cache isn't up to date (or is invalid).
        if ($cache['checksum'] !== $this->checksum()) {
            return false;
        }

        $this->createObject($cache['data']);
        $this->timestamp = $cache['timestamp'] ?? 0;

        $this->finalizeObject();

        return true;
    }
487053
public function loadLocalConfig()
    {
        $home_folder = getenv('HOME') ?: getenv('HOMEDRIVE') . getenv('HOMEPATH');
        $local_config_file = $home_folder . '/.grav/config';

        if (file_exists($local_config_file)) {
            $file = YamlFile::instance($local_config_file);
            $this->local_config = $file->content();
            $file->free();
            return $local_config_file;
        }

        return false;
    }
73170
public function load($configFileName = null)
    {
        $configs = [];

        // load all local configs (config files that are not user-facing)
        $localConfig = [];
        foreach ($this->localConfigStack as $file) {
            $config = include $file;
            $localConfig = array_merge_recursive($localConfig, $config);
        }
        if (!empty($localConfig)) {
            $configs[] = $localConfig;
        }

        // load the current project's config file (user-facing)
        if (null === $configFileName) {
            $configFileName = $this->defaultFileName;
        }
        if ($this->projectFileSystem->has($configFileName)) {
            $configs[] = Yaml::parse($this->projectFileSystem->read($configFileName));
        }

        // validate and merge all configs
        $config = $this->processor->processConfiguration(
            $this->definition,
            $configs
        );

        return new $this->configClass($config);
    }
539997
protected function _loadFile($filename='')
    {
        if (is_null($this->_reader)) {
            $this->_reader = new Mage_Connect_Package_Reader($filename);
        }
        $content = $this->_reader->load();
        $this->_packageXml = simplexml_load_string($content);
        return $this;
    }