Retrieves the array configuration from app.forms

@param string $configPath

@return Form
542729
protected function getForm($configPath)
    {
        $form = null;
        $melisConfig = $this->serviceLocator->get('MelisInstallerConfig');
        $formConfig = $melisConfig->getItem($configPath);

        if ($formConfig) {
            $factory = new \Zend\Form\Factory();
            $formElements = $this->getServiceLocator()->get('FormElementManager');
            $factory->setFormElementManager($formElements);
            $form = $factory->createForm($formConfig);
        }

        return $form;
    }
336999
protected function getConfigurationFiles($directoryPath)
    {
        $files = [];

        if (is_dir($directoryPath)) {
            foreach (Finder::create()->files()->in($directoryPath) as $file) {
                $group = basename($file->getRealPath(), '.php');
                $files[$group] = $file->getRealPath();
            }
        }

        return $files;
    }
588043
public function loadFile($path) {
        $config = null;

        try {
            $config = require $path;
        } catch (Exception $ex) {}

        if ( ! is_array($config)) {
            throw new InvalidConfigFormatException(
                s('ArrayConfigDriver expects config at path %s to be of format array[key => value].', $path)
            );
        }

        return $config;
    }
671056
public static function initializeConfigs(
        string $configPath = '.env',
        bool $absolutePath = true,
        string $separator = '='
    ): void {
        /* Set path */
        self::$path = ($absolutePath ? $_SERVER['DOCUMENT_ROOT'] : '') . $configPath;

        /* Change separator */
        self::$separator = $separator;

        /* Check if file exists */
        if (!file_exists(self::$path)) {
            return;
        }

        /* Get content in config file */
        $lines = file(self::$path);

        /* Parse content to config array */
        foreach ($lines as $line) {
            /* Skip Empty Line and Comment Line */
            if (trim(rtrim($line, "\n")) == '' || trim($line)[0] == '#') {
                continue;
            }

            /* Parse */
            $parsedConfig = self::parseContent($line);

            /* Set Config Array */
            self::$configs[$parsedConfig['key']] = $parsedConfig['value'];
        }

        /* Set initialized */
        self::$initialized = true;
    }
396889
protected function getElasticSuiteConfigParam($configField)
    {
        $path = self::BASE_CONFIG_XML_PREFIX . '/' . $configField;

        return $this->scopeConfig->getValue($path);
    }
65249
public function loadConfig($configFile = 'config.user.php', $configPath = 'app/config') {
        $completePath = ROOT . DS . $configPath . DS . $configFile;

        if (!file_exists($completePath)) {
            throw new ConfigException("Specified config file does not exist: " . $completePath);
        }

        include($completePath);

        if (isset($pffConfig) && is_array($pffConfig)) {
            $this->_config = array_merge($this->_config, $pffConfig);
        } else {
            throw new ConfigException("Failed to load configuration file!
                                            The file seems to be corrupted: " . $completePath);
        }
    }
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;
    }
355787
function customConfigIsBeingImported($customConfigPath)
    {
        return strpos($this->files->get($this->configPath), $customConfigPath) !== false;
    }
677969
public static function loadConfigFiles($configPath = false)
    {
        if(!is_dir($configPath)) {
            throw new \Exception("Config directory {$configPath} not found!");
        }

        $filesToBeLoaded = scandir($configPath);
        foreach($filesToBeLoaded as $_file) {
            if(preg_match('/.*\.php/',$_file)) {
                include_once $configPath.DIRECTORY_SEPARATOR.$_file;
            }
        }

        return true;
    }
347973
protected function runConfigFile($configPath)
    {
        $this->phpci->logExecOutput(false);

        $codecept = $this->phpci->findBinary('codecept');

        if (!$codecept) {
            $this->phpci->logFailure(Lang::get('could_not_find', 'codecept'));

            return false;
        }

        $cmd = 'cd "%s" && ' . $codecept . ' run -c "%s" --xml ' . $this->args;

        if (IS_WIN) {
            $cmd = 'cd /d "%s" && ' . $codecept . ' run -c "%s" --xml ' . $this->args;
        }

        $configPath = $this->phpci->buildPath . $configPath;
        $success = $this->phpci->executeCommand($cmd, $this->phpci->buildPath, $configPath);

        $this->phpci->log(
            'Codeception XML path: '. $this->phpci->buildPath . $this->path . 'report.xml',
            Loglevel::DEBUG
        );

        $xml = file_get_contents($this->phpci->buildPath . $this->path . 'report.xml', false);
        $parser = new Parser($this->phpci, $xml);
        $output = $parser->parse();

        $meta = array(
            'tests'     => $parser->getTotalTests(),
            'timetaken' => $parser->getTotalTimeTaken(),
            'failures'  => $parser->getTotalFailures()
        );

        $this->build->storeMeta('codeception-meta', $meta);
        $this->build->storeMeta('codeception-data', $output);
        $this->build->storeMeta('codeception-errors', $parser->getTotalFailures());
        $this->phpci->logExecOutput(true);

        return $success;
    }
1369925
protected function buildAppConfig($configPath)
    {
        $config = require($configPath);

        $callback = Arr::get($this->config, 'callback.vendor_config');
        if ($callback instanceof Closure) {
            $config = call_user_func($callback, $config);
        }

        return $config;
    }
210055
protected function getConfigurationNesting(SplFileInfo $file, $configPath)
    {
        $directory = $file->getPath();

        if ($tree = trim(str_replace($configPath, '', $directory), DIRECTORY_SEPARATOR)) {
            $tree = str_replace(DIRECTORY_SEPARATOR, '.', $tree) . '.';
        }

        return $tree;
    }
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;
    }
1313332
final public function get(array $appConfig): array
    {
        assert($appConfig !== null);

        $defaults = $this->getSettings();

        $eventsFolder = $defaults[static::KEY_EVENTS_FOLDER] ?? null;
        assert(
            $eventsFolder !== null && empty(glob($eventsFolder)) === false,
            "Invalid Events folder `$eventsFolder`."
        );

        $eventsFileMask = $defaults[static::KEY_EVENTS_FILE_MASK] ?? null;
        assert(empty($eventsFileMask) === false, "Invalid Events file mask `$eventsFileMask`.");

        $subscribersFolder = $defaults[static::KEY_SUBSCRIBERS_FOLDER] ?? null;
        assert(
            $subscribersFolder !== null && empty(glob($subscribersFolder)) === false,
            "Invalid Subscribers folder `$subscribersFolder`."
        );

        $subscribersFileMask = $defaults[static::KEY_SUBSCRIBERS_FILE_MASK] ?? null;
        assert(empty($subscribersFileMask) === false, "Invalid Subscribers file mask `$subscribersFileMask`.");

        $eventsPath      = $eventsFolder . DIRECTORY_SEPARATOR . $eventsFileMask;
        $subscribersPath = $subscribersFolder . DIRECTORY_SEPARATOR . $subscribersFileMask;

        $emitter      = new SimpleEventEmitter();
        /** @noinspection PhpParamsInspection */
        $eventClasses = iterator_to_array(
            $this->selectClasses($eventsPath, EventInterface::class)
        );
        /** @noinspection PhpParamsInspection */
        $handlerClasses = iterator_to_array(
            $this->selectClasses($subscribersPath, EventHandlerInterface::class)
        );

        $allowedEvents = $this->getParentEvents($eventClasses);
        $emitter->addAllowedEvents($allowedEvents);

        foreach ($this->getEventSubscribers($eventClasses, $handlerClasses) as $eventClass => $subscriber) {
            $emitter->subscribe($eventClass, $subscriber);
        }

        $cacheData = $emitter->getData();

        return $defaults + [static::KEY_CACHED_DATA => $cacheData];
    }
726357
protected function loadConfigurationFile(string $configurationPath): array
    {
        $configurations = [];

        if ($configurationPath && is_dir($configurationPath)) {
            if (is_dir($configurationPath)) {
                $configurationFiles = new FilesystemIterator($configurationPath, FilesystemIterator::SKIP_DOTS);

                /** @var SplFileInfo $configurationFiles */
                foreach ($configurationFiles as $file) {
                    $configurations += $this->getConfigurationFile($file);
                }
            } else {
                if (is_file($configurationPath)) {
                    $configurations += $this->getConfigurationFile($configurationPath);
                }
            }
        }

        return $configurations;
    }
149916
private function massageConfig(array $config, string $configPath) : array
    {
        if (!isset($config['installed_paths'])) {
            return $config;
        }

        $config['installed_paths'] = implode(',', array_map(function ($path) use ($configPath) {
            return dirname($configPath) . '/' . $path;
        }, explode(',', $config['installed_paths'])));

        return $config;
    }
1243535
public function loadWithDefault(string $configPath, string $defaultConfigPath): void
    {
        if (!file_exists($configPath)) {
            return;
        }
        $configDefault = include $defaultConfigPath;
        $config = include $configPath;
        if (!is_array($configDefault) && !is_array($config)) {
            return;
        }
        $this->loadArray(array_merge($configDefault, $config));
    }