reads the specific config file

@param string $configPath

@return array
487778
private function getConfigFileContent(string $configPath) : array
    {
        // if empty just skip it
        if (!filesize($configPath)) {
            return [];
        }

        // read the file handler
        $config = file_get_contents($configPath);

        // check for linebreaks
        if (strpos($config, "\n") === false) {
            $config = [
                $config
            ];
        } else {
            $config = (array) explode("\n", $config);
        }

        return $config;
    }
290428
private function getConfigArray($cfgPath)
    {
        //====================================================================//
        //  Check if Custom Configuration File Exists
        if (!is_file($cfgPath)) {
            return false;
        }
        //====================================================================//
        //  Load File Contents
        $rawJson = file_get_contents($cfgPath);
        if (!is_string($rawJson)) {
            return false;
        }
        //====================================================================//
        //  Decode Json Contents
        $json = json_decode($rawJson, true);
        if (!is_array($json)) {
            Splash::log()->war("Invalid Json Configuration. Overrides Skipped!");

            return false;
        }
        Splash::log()->deb("Loaded Custom Configuration From: ".$cfgPath);

        return $json;
    }
547499
public function load(string $configPath): PluginManager
    {
        $this->setDirectory();
        $this->setConstants();
        $this->setPrefix();
        $this->loadPluginConfiguration($configPath);
        $this->setPluginAutoloading();

        return $this;
    }
496730
protected function loadFiles($path): array
    {
        $config = [];

        if (!is_dir($path)) {
            throw new ConfigException("Configuration directory `$path` not found");
        }

        $iterator = new \GlobIterator(
            $path . '/*.php',
            \FilesystemIterator::KEY_AS_FILENAME | \FilesystemIterator::CURRENT_AS_PATHNAME
        );

        foreach ($iterator as $name => $file) {
            $name = substr($name, 0, -4);
            $config[$name] = $this->loadFile($file);
        }
        return $config;
    }
380459
protected static function loadConfigFile($path)
    {
        if (!is_file($path)) {
            throw new Exception\WorkerException("Configuration file not exist '{$path}'");
        }

        $extension = pathinfo($path, PATHINFO_EXTENSION);

        if ('php' === $extension) {
            $config = require_once($path);
        } elseif ('json' === $extension) {
            $config = file_get_contents($path);
            $config = json_decode($config, true);
        } else {
            throw new Exception\WorkerException("Configuration file must be PHP or JSON : '{$path}'");
        }

        if (!is_array($config)) {
            throw new Exception\WorkerException("Configuration file must return array inside '{$path}'");
        }

        return $config;
    }
1122543
protected function getConfigurationFiles($path)
	{
		$files = [];

		foreach (Finder::create()->files()->name('*.php')->in($path) as $file)
		{
			$files[basename($file->getRealPath(), '.php')] = $file->getRealPath();
		}

		return $files;
	}
1059477
private function _getConfigValues($pPath, $pForceGlobalArray)
    {
        $pathArr = explode(DS, $pPath, 2);
        if (! isset($pathArr[1])) {
            return NULL;
        }

        $path = rtrim($pathArr[1], '/');

        if ($pPath === self::CONFIG_EVENTS_PATH) {
            $content = $this->_getEventsConfig();
        } else {
            $content = $this->_getInstance($pathArr[0]);
        }

        if ($path) {
            $pathArr = explode('/', $path);
            $nbKeys  = count($pathArr) - 1;

            foreach($pathArr as $i => $key) {
                $key = str_replace('#', '/', $key);

                if (! isset($content[$key])) {
                    $this->_cache[$pPath] = NULL;
                    break;
                } else if ($i < $nbKeys) {
                    $content = $content[$key];
                } else if ($i == $nbKeys) {
                    $this->_cache[$pPath] = $content[$key];
                }
            }
        } else {
            $this->_cache[$pPath] = $content;
        }

        if ($pForceGlobalArray and (! is_array($this->_cache[$pPath]) or (is_array($this->_cache[$pPath]) and ! array_key_exists(0, $this->_cache[$pPath])))) {
            $this->_cache[$pPath] = array($this->_cache[$pPath]);
        }

        return $this->_cache[$pPath];
    }
855933
protected function getConfigArr(string $configAppFile) : array
    {
        $configCoreFile = __DIR__.'/../Config/config.php';
        $configCore = $this->requireFile($configCoreFile);
        $configApp = $this->requireFile($configAppFile);
        
        $services = [];
        $skipCoreServices = $configApp['skipCoreServices'] ?? false;
        if (isset($configCore['services']) && !$skipCoreServices) {
            $services[] = $configCore['services'];
        }
        if (isset($configApp['services'])) {
            $services[] = $configApp['services'];
        }
        $configArr = array_replace_recursive($configCore, $configApp);
        $configArr['services'] = $services;
        
        return $configArr;
    }
174639
public static function readConfigFile($path = '')
    {
        $path = str_replace('..', '', $path);
        $realPath = self::$configDir . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);
        $cachedFile = self::$cachePath . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path).'.php';
        if (file_exists($cachedFile) && self::$config['cache'] === true) {
            $conf = require_once($cachedFile);
        } else {
            if (file_exists($realPath)) {
                switch (self::$configExt) {
                    case 'xml':
                        $objConfig = simplexml_load_file($realPath);
                        $conf = json_decode(json_encode($objConfig), true);
                        break;
                    case 'yaml':
                        $conf = Yaml::parse(file_get_contents($realPath));
                        break;
                    default:
                        $conf = require_once $realPath;
                        break;
                }
                if (self::$config['cache'] === true) {
                    touch($cachedFile);
                    $str = "<?php\nreturn ".var_export($conf, true).";\n";
                    file_put_contents($cachedFile, $str);
                }
            }
        }
        return $conf;
    }
431395
public function readConfigs() 
	{
        $paths = array('~/bookability.ini', '/etc/bookability.ini');
        foreach($paths as $path) 
		{
            if (file_exists($path)) 
			{
                $config = parse_ini_file($path);
                if ($config) 
				{
                    return $config;
                }
            }
        }
        return array();
    }
690712
public function readConfig($path)
    {
        $jsonFile = new JsonFile($path);
        $config = $jsonFile->exists() ? $jsonFile->read() : [];
        foreach ($this->dependencies as $key) {
            if (!isset($config[$key])) {
                $config[$key] = [];
            }
        }
        return $config;
    }
942980
public function read($path)
    {
        $location = $this->applyPathPrefix($path);
        return [
            'contents' => $this->ossClient->getObject($this->bucket, $location)
        ];
    }
967891
public function load($configPath, $targetPath)
  {
    $mapper = new AssetMapper();
    $configDir = dirname($configPath);

    $parameters = $this->parser->load($configPath);
    foreach ($parameters as $key => $value) {
      if (in_array($key, $this->dirs)) {
        $mapper->map(
          $configDir . "/" . $value,
          $targetPath . "/" . $value
        );
      }
    }

    return $mapper;
  }
802987
public function getConfigFiles($configs = [])
    {
        $finder = $this->make(Finder::class)
            ->files()
            ->in($this->configPath())
            ->name('*.php');

        foreach ($finder as $file) {
            $configs[basename($file->getFilename(), '.php')] = require $file->getRealPath();
        }

        return $configs;
    }
738354
private function loadConfigurationFiles($path)
    {
        $this->configPath = $path;

        foreach ($this->getConfigurationFiles() as $fileKey => $path) {
            $this->set($fileKey, require $path);
        }

        foreach ($this->getConfigurationFiles() as $fileKey => $path) {
            $envConfig = require $path;

            foreach ($envConfig as $envKey => $value) {
                $this->set($fileKey.'.'.$envKey, $value);
            }
        }
    }
1133034
public static function init($configPath = null)
    {
        if (!isset(self::$instances[$configPath])) {
            self::$instances[$configPath] = new IDS_Init($configPath);
        }

        return self::$instances[$configPath];
    }
648395
protected function getConfigurationFiles($path)
    {
        $files = [];

        foreach (Finder::create()->files()->name('*.php')->in($path) as $file) {
            $directory = $this->getNestedDirectory($file, $path);
            $files[$directory.basename($file->getRealPath(), '.php')] = $file->getRealPath();
        }

        ksort($files, SORT_NATURAL);

        return $files;
    }