Generates the bundles map.

@return ConfigInterface[]
177436
private function loadFromPlugins(bool $development, string $cacheFile = null): array
    {
        $resolver = $this->resolverFactory->create();

        /** @var BundlePluginInterface[] $plugins */
        $plugins = $this->pluginLoader->getInstancesOf(PluginLoader::BUNDLE_PLUGINS);

        foreach ($plugins as $plugin) {
            foreach ($plugin->getBundles($this->parser) as $config) {
                $resolver->add($config);
            }
        }

        $bundleConfigs = $resolver->getBundleConfigs($development);

        if (null !== $cacheFile) {
            $this->filesystem->dumpFile($cacheFile, sprintf('<?php return %s;', var_export($bundleConfigs, true)));
        }

        return $bundleConfigs;
    }
1009347
public function getIncludeMap(): array
    {
        if ($this->cachedIncludeMap === null) {
            $this->cachedIncludeMap = $this->getRawIncludeMap();
        }

        return $this->cachedIncludeMap;
    }
432919
protected function getMappingData(): array
    {
        $mappings = [];

        foreach ($this->locator->getMappingFiles() as $mappingFile) {
            $mappings[] = $this->loadMappingFile($mappingFile);
        }

        $mappingData = [];
        foreach ($mappings as $mapping) {
            $mappingData = $this->mergeMappings($mappingData, $mapping);
        }

        return $mappingData;
    }
525997
public function findAllGeneratorYamls()
    {
        if (null !== $this->yamls) {
            return $this->yamls;
        }

        $yamls = array();

        foreach ($this->kernel->getBundles() as $name => $bundle) {
            foreach ($this->findGeneratorYamlInBundle($bundle) as $yaml) {
                $yamls[$yaml] = $yaml;
            }
        }

        return $this->yamls = $yamls;
    }
738945
private function initBundles()
    {
        $bundleLoader = $this->getContainer()->get('bundle.loader');
        if (!$bundleLoader->isRestored() && null !== $this->getConfig()->getBundlesConfig()) {
            $bundleLoader->load($this->getConfig()->getBundlesConfig());
        }

        return $this;
    }
1309103
public static List<BundleModel> bundles(BundleContext context) {
        List<BundleModel> bundles = new ArrayList<>();
        for (Bundle bundle : context.getBundles()) {
            bundles.add(new BundleModel(bundle));
        }
        return bundles;
    }
109354
public Set<String> getConfiguredWorkplaceBundles() {

        Set<String> result = new HashSet<String>();
        for (CmsResourceTypeConfig config : internalGetResourceTypes(false)) {
            String bundlename = config.getConfiguredWorkplaceBundle();
            if (null != bundlename) {
                result.add(bundlename);
            }
        }
        return result;
    }
440643
public function getBundles()
    {
        $bundles = [];
        foreach ($this->getContainer()->findTaggedServiceIds('bundle') as $id => $datas) {
            $bundles[] = $this->getContainer()->get($id);
        }

        return $bundles;
    }
501559
protected function getPublishingMap(AssetPackageInterface $package, ConfigInterface $config): array
    {
        /**
         * internals!
         * @var Config $config
         * @var AdminLtePackage $package
         */
        $forPublishing = $package->getDistMap();
        if ($config->isBootstrapEnabled()) {
            $forPublishing += $package->getBootstrapMap();
        }
        if ($config->isDemoEnabled()) {
            $forPublishing += $package->getDemoMap();
        }
        if ($config->isPluginsEnabled()) {
            $forPublishing += $package->getPluginsMap();
        }
        return $forPublishing;
    }
1156837
public function getMapTables()
    {
        $tables = [];

        if (is_array($GLOBALS['con4gis']['maps']['sourcetable']))
        {
            foreach ($GLOBALS['con4gis']['maps']['sourcetable'] as $key=>$sourcetable) {
                $tables[$key] = $GLOBALS['TL_LANG']['c4g_maps']['sourcetable'][$key]['name'];
            }
        }

        return $tables;
    }
96724
protected function doGetBundles() {
		$cache = $this->getCache();
		if($cache)
			$bundles = $cache->fetch('asgard.bundles');

		if(!isset($bundles) || $bundles === false) {
			$bundles = array_merge($this->addedBundles, $this->getBundles());

			$newBundles = false;
			foreach($bundles as $k=>$v) {
				if(is_string($v)) {
					$bundle = realpath($v);
					if(!$bundle)
						throw new \Exception('Bundle '.$v.' does not exist.');
					unset($bundles[$k]);
					$bundles[$bundle] = null;
					$newBundles = true;

					if(file_exists($bundle.'/Bundle.php'))
						require_once $bundle.'/Bundle.php';
				}
			}
			if($newBundles) {
				foreach(get_declared_classes() as $class) {
					if(!is_subclass_of($class, 'Asgard\Core\BundleLoader'))
						continue;
					$reflector = new \ReflectionClass($class);
					$dir = dirname($reflector->getFileName());
					if(array_key_exists($dir, $bundles) && $bundles[$dir] === null) {
						unset($bundles[$dir]);
						$bundles[] = new $class;
					}
				}
			}
			foreach($bundles as $bundle=>$obj) {
				if($obj === null) {
					$obj = new BundleLoader;
					$obj->setPath($bundle);
					$bundles[$bundle] = $obj;
				}
			}

			#Remove duplicates
			$kbundles = array_keys($bundles);
			$vbundles = array_values($bundles);
			foreach($vbundles as $k=>$b) {
				$key = $kbundles[$k];
				for($i=$k+1; isset($bundles[$i]); $i++) {
					if($b->getPath() === $bundles[$i]->getPath())
						unset($bundles[$k]);
				}
			}

			foreach($bundles as $bundle) {
				$bundle->setHooksAnnotationReader($this->getHooksAnnotationReader());
				$bundle->setControllersAnnotationReader($this->getControllersAnnotationReader());
			}

			if($cache)
				$cache->save('asgard.bundles', $bundles);
		}

		return $bundles;
	}
882393
protected function getConfigurationFiles()
    {
        $files = [];
        $path  = $this->laravel->configPath();
        $found = Finder::create()->files()->name('*.php')->depth('== 0')->in($path);

        foreach ($found as $file) {
            $files[] = basename($file->getRealPath(), '.php');
        }

        return $files;
    }
1309370
private function getMetadataDirs()
    {
        if (null === $this->metadataDirs) {
            $this->metadataDirs = array();
            $bundles = $this->kernel->getBundles();
            $fs = new Filesystem();

            /**
             * @var string $bundleName
             * @var BundleInterface $bundle
             */
            foreach ($bundles as $bundleName => $bundle) {
                $directory = $this->kernel->locateResource("@$bundleName/Resources");
                $directory .= '/config/m7_encryption';
                if ($fs->exists($directory)) {
                    $nameSpace = $bundle->getNamespace();
                    $this->metadataDirs[$nameSpace] = $directory;
                }
            }
        }

        return $this->metadataDirs;
    }
956926
public static function bindings()
    {
        return [
            Contracts\CategoryRepositoryContract::class => Categories\Repositories\CategoriesRepository::class,
            Contracts\FeaturesRepositoryContract::class => Features\Repositories\FeaturesRepository::class,
        ];
    }
1013506
private List<JoinableResourceBundle> getBundlesToRebuild() {
		List<JoinableResourceBundle> bundlesToRebuild = new ArrayList<>();

		if (config.getUseSmartBundling()) {

			for (JoinableResourceBundle bundle : globalBundles) {
				if (bundle.isDirty()) {
					bundlesToRebuild.add(bundle);
				}
			}
			for (JoinableResourceBundle bundle : contextBundles) {
				if (bundle.isDirty()) {
					bundlesToRebuild.add(bundle);
				}
			}
		}
		return bundlesToRebuild;
	}
911815
public function getConfigServiceId()
    {
        return strtolower(str_replace(
            '%bundle_service_id%',
            str_replace('%bundle_name%', $this->id, BundleInterface::BUNDLE_SERVICE_ID_PATTERN),
            BundleInterface::CONFIG_SERVICE_ID_PATTERN
        ));
    }
930858
protected function getModuleConfig(): array
    {
        $merged = [];
        $merger = $this->getMerger();
        foreach ($this->getModules() as $module) {
            if ($module instanceof ConditionProviderInterface && $module->isConditioned() === true) {
                continue;
            }

            if ($module instanceof ConfigProviderInterface) {
                $merged = $merger->merge(
                    $merged,
                    $module->getConfig()->load()
                );
            }
        }

        return $merged;
    }