N98\Magento\Application\ConfigurationLoader::loadPluginConfig PHP Method

loadPluginConfig() public method

Load config from all installed bundles
public loadPluginConfig ( array $config, string $magentoRootFolder ) : array
$config array
$magentoRootFolder string
return array
    public function loadPluginConfig(array $config, $magentoRootFolder)
    {
        if ($this->_pluginConfig == null) {
            $this->_pluginConfig = array();
            $moduleBaseFolders = array();
            $customFilename = $this->_customConfigFilename;
            $customName = pathinfo($customFilename, PATHINFO_FILENAME);
            if (OperatingSystem::isWindows()) {
                $config['plugin']['folders'][] = getenv('WINDIR') . '/' . $customName . '/modules';
                $config['plugin']['folders'][] = OperatingSystem::getHomeDir() . '/' . $customName . '/modules';
            } else {
                $config['plugin']['folders'][] = OperatingSystem::getHomeDir() . '/.' . $customName . '/modules';
            }
            $config['plugin']['folders'][] = $magentoRootFolder . '/lib/' . $customName . '/modules';
            foreach ($config['plugin']['folders'] as $folder) {
                if (is_dir($folder)) {
                    $moduleBaseFolders[] = $folder;
                }
            }
            /**
             * Allow modules to be placed vendor folder if not in phar mode
             */
            if (!$this->_isPharMode) {
                if (is_dir($this->getVendorDir())) {
                    $finder = Finder::create();
                    $finder->files()->depth(2)->followLinks()->ignoreUnreadableDirs(true)->name($customFilename)->in($this->getVendorDir());
                    foreach ($finder as $file) {
                        /* @var $file SplFileInfo */
                        $this->registerPluginConfigFile($magentoRootFolder, $file);
                    }
                }
            }
            if (count($moduleBaseFolders) > 0) {
                // Glob plugin folders
                $finder = Finder::create();
                $finder->files()->depth(1)->followLinks()->ignoreUnreadableDirs(true)->name($customFilename)->in($moduleBaseFolders);
                foreach ($finder as $file) {
                    /* @var $file SplFileInfo */
                    $this->registerPluginConfigFile($magentoRootFolder, $file);
                }
            }
        }
        $config = ArrayFunctions::mergeArrays($config, $this->_pluginConfig);
        return $config;
    }