public function buildContainer(ContainerInterface $container) { $kernelBundleDirs = $container->getParameter('kernel.bundle_dirs'); $kernelBundles = $container->getParameter('kernel.bundles'); $appName = $container->getParameter('kernel.name'); $cacheDir = $container->getParameter('kernel.cache_dir'); Loader::registerExtension(new MongoDBExtension($kernelBundleDirs, $kernelBundles, $appName, $cacheDir)); $metadataDirs = array(); $documentDirs = array(); $bundleDirs = $kernelBundleDirs; foreach ($kernelBundles as $className) { $tmp = dirname(str_replace('\\', '/', $className)); $namespace = str_replace('/', '\\', dirname($tmp)); $class = basename($tmp); if (isset($bundleDirs[$namespace])) { if (is_dir($dir = $bundleDirs[$namespace] . '/' . $class . '/Resources/config/doctrine/metadata')) { $metadataDirs[] = realpath($dir); } if (is_dir($dir = $bundleDirs[$namespace] . '/' . $class)) { $documentDirs[] = realpath($dir); } } } $container->setParameter('doctrine.odm.metadata_driver.mapping_dirs', $metadataDirs); $container->setParameter('doctrine.odm.document_dirs', $documentDirs); }
public function boot(ContainerInterface $container) { require_once $container->getParameter('propel.path') . '/runtime/lib/Propel.php'; if (0 === strncasecmp(PHP_SAPI, 'cli', 3)) { set_include_path($container->getParameter('propel.phing_path') . '/classes' . PATH_SEPARATOR . get_include_path()); } $kernel = $container->getKernelService(); if (!file_exists($autoload = $kernel->getCacheDir() . '/propel_autoload.php')) { $map = array(); foreach ($kernel->getBundles() as $bundle) { if (!file_exists($file = $bundle->getPath() . '/Resources/config/classmap.php')) { continue; } $local = (include $file); foreach ($local as $class => $path) { $map[$class] = $bundle->getPath() . '/' . $path; } } file_put_contents($autoload, '<?php return ' . var_export($map, true) . ';'); } $autoloader = \PropelAutoloader::getInstance(); $autoloader->addClassPaths(include $autoload); $autoloader->register(); $container->getPropelService(); }
/** * Boots the Bundle. * * @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance */ public function boot(ContainerInterface $container) { $container->getErrorHandlerService(); // load core classes if ($container->getParameter('kernel.include_core_classes')) { ClassCollectionLoader::load($container->getParameter('kernel.compiled_classes'), $container->getParameter('kernel.cache_dir'), 'classes', $container->getParameter('kernel.debug')); } }
public function boot(ContainerInterface $container) { require_once $container->getParameter('propel.path') . '/runtime/lib/Propel.php'; if (0 === strncasecmp(PHP_SAPI, 'cli', 3)) { set_include_path($container->getParameter('propel.phing_path') . '/classes' . PATH_SEPARATOR . get_include_path()); } $container->getPropelService(); }
/** * Customizes the Container instance. * * @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance * * @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance */ public function buildContainer(ContainerInterface $container) { Loader::registerExtension(new WebExtension($container->getParameter('kernel.bundle_dirs'), $container->getParameter('kernel.bundles'))); $dirs = array('%kernel.root_dir%/views/%%bundle%%/%%controller%%/%%name%%%%format%%.%%renderer%%'); foreach ($container->getParameter('kernel.bundle_dirs') as $dir) { $dirs[] = $dir . '/%%bundle%%/Resources/views/%%controller%%/%%name%%%%format%%.%%renderer%%'; } $container->setParameter('templating.loader.filesystem.path', $dirs); $configuration = new BuilderConfiguration(); if ($container->getParameter('kernel.debug')) { $loader = new XmlFileLoader(__DIR__ . '/Resources/config'); $configuration->merge($loader->load('debug.xml')); } return $configuration; }
public function buildContainer(ContainerInterface $container) { Loader::registerExtension(new WebExtension()); $dirs = array('%kernel.root_dir%/views/%%bundle%%/%%controller%%/%%name%%%%format%%.php'); foreach ($container->getParameter('kernel.bundle_dirs') as $dir) { $dirs[] = $dir . '/%%bundle%%/Resources/views/%%controller%%/%%name%%%%format%%.php'; } $container->setParameter('templating.loader.filesystem.path', $dirs); }
public function buildContainer(ContainerInterface $container) { Loader::registerExtension(new DoctrineExtension($container->getParameter('kernel.bundle_dirs'), $container->getParameter('kernel.bundles'))); $metadataDirs = array(); $entityDirs = array(); $bundleDirs = $container->getParameter('kernel.bundle_dirs'); foreach ($container->getParameter('kernel.bundles') as $className) { $tmp = dirname(str_replace('\\', '/', $className)); $namespace = str_replace('/', '\\', dirname($tmp)); $class = basename($tmp); if (isset($bundleDirs[$namespace])) { if (is_dir($dir = $bundleDirs[$namespace] . '/' . $class . '/Resources/config/doctrine/metadata')) { $metadataDirs[] = realpath($dir); } if (is_dir($dir = $bundleDirs[$namespace] . '/' . $class . '/Entities')) { $entityDirs[] = realpath($dir); } } } $container->setParameter('doctrine.orm.metadata_driver.mapping_dirs', $metadataDirs); $container->setParameter('doctrine.orm.entity_dirs', $entityDirs); }
public function buildContainer(ContainerInterface $container) { Loader::registerExtension(new MongoDBExtension($container->getParameter('kernel.bundles'))); }