31 lines
1.1 KiB
PHP
31 lines
1.1 KiB
PHP
<?php
|
|
|
|
use KupShop\KupShopBundle\Util\System\BundleFinder;
|
|
use KupShop\KupShopBundle\Util\System\PathFinder;
|
|
|
|
$cfg = \KupShop\KupShopBundle\Config::get();
|
|
|
|
$container->setParameter('kupshop.db.host', $cfg['Connection']['host']);
|
|
$container->setParameter('kupshop.db.database', $cfg['Connection']['database']);
|
|
$container->setParameter('kupshop.db.user', $cfg['Connection']['user']);
|
|
$container->setParameter('kupshop.db.password', $cfg['Connection']['password']);
|
|
$container->setParameter('kupshop.cache.symfonyMemcached', $cfg['Cache']['symfonyMemcached'] ?? 'memcached://localhost');
|
|
|
|
$bundleFinder = new BundleFinder(new PathFinder());
|
|
$bundleFinder->setContainer($container);
|
|
|
|
$loadCoreConfig = function ($file) use ($bundleFinder, $loader) {
|
|
foreach ($bundleFinder->getExistingBundlesPath('Resources/config/'.$file) as $path) {
|
|
$loader->import($path);
|
|
}
|
|
};
|
|
|
|
$loadCoreConfig('core-config.yml');
|
|
|
|
$env = $container->getParameter('kernel.environment');
|
|
$loadCoreConfig("core-config_{$env}.yml");
|
|
|
|
if (findModule(Modules::COMPONENTS)) {
|
|
$loadCoreConfig('components-config.yml');
|
|
}
|