Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 53 lines (46 sloc) 2.071 kb
577df30 @fabpot renamed Symfony\Framework to Symfony\Bundle
fabpot authored
1 <?php
2
08fd722 @blue-eyes normalized license messages in PHP files
blue-eyes authored
3 /*
6bed7e1 @stof Updated license header
stof authored
4 * This file is part of the Doctrine MongoDBBundle
5 *
6 * The code was originally distributed inside the Symfony framework.
08fd722 @blue-eyes normalized license messages in PHP files
blue-eyes authored
7 *
b278f2c @fabpot replaced symfony-project.org by symfony.com
fabpot authored
8 * (c) Fabien Potencier <fabien@symfony.com>
6bed7e1 @stof Updated license header
stof authored
9 * (c) Doctrine Project
08fd722 @blue-eyes normalized license messages in PHP files
blue-eyes authored
10 *
11 * For the full copyright and license information, please view the LICENSE
12 * file that was distributed with this source code.
13 */
14
7bf1302 @stof Changed the namespace to Doctrine\Bundle\MongoDBBundle
stof authored
15 namespace Doctrine\Bundle\MongoDBBundle;
577df30 @fabpot renamed Symfony\Framework to Symfony\Bundle
fabpot authored
16
7bf1302 @stof Changed the namespace to Doctrine\Bundle\MongoDBBundle
stof authored
17 use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\CreateHydratorDirectoryPass;
18 use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\CreateProxyDirectoryPass;
19 use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\EventManagerPass;
20 use Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension;
4d86370 @stof Added the compiler pass to load the validation conditionally
stof authored
21 use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\DoctrineValidationPass;
bba3fe2 @stof Added a user provider
stof authored
22 use Symfony\Bridge\Doctrine\DependencyInjection\Security\UserProvider\EntityFactory;
a97293b @kriswallsmith sorted use statements
kriswallsmith authored
23 use Symfony\Component\DependencyInjection\Compiler\PassConfig;
24 use Symfony\Component\DependencyInjection\ContainerBuilder;
25 use Symfony\Component\HttpKernel\Bundle\Bundle;
577df30 @fabpot renamed Symfony\Framework to Symfony\Bundle
fabpot authored
26
27 /**
28 * Doctrine MongoDB ODM bundle.
29 *
62f4fce @jmikola Update author attribution for Bulat
jmikola authored
30 * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
03f2979 @kriswallsmith updated email address
kriswallsmith authored
31 * @author Kris Wallsmith <kris@symfony.com>
577df30 @fabpot renamed Symfony\Framework to Symfony\Bundle
fabpot authored
32 * @author Jonathan H. Wage <jonwage@gmail.com>
33 */
4a92955 @avalanche123 [DoctrineMongoDBBundle] removed trailing space
avalanche123 authored
34 class DoctrineMongoDBBundle extends Bundle
577df30 @fabpot renamed Symfony\Framework to Symfony\Bundle
fabpot authored
35 {
5842458 @fabpot added the concept of a main DIC extension for bundles
fabpot authored
36 public function build(ContainerBuilder $container)
9a8c63a @avalanche123 [DoctrineMongoDBBundle] switched to compiler passes for proxy/hydrator d...
avalanche123 authored
37 {
d9e1a24 @kriswallsmith cleaned up event manager pass
kriswallsmith authored
38 $container->addCompilerPass(new EventManagerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
9a8c63a @avalanche123 [DoctrineMongoDBBundle] switched to compiler passes for proxy/hydrator d...
avalanche123 authored
39 $container->addCompilerPass(new CreateProxyDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
40 $container->addCompilerPass(new CreateHydratorDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
4d86370 @stof Added the compiler pass to load the validation conditionally
stof authored
41 $container->addCompilerPass(new DoctrineValidationPass('mongodb'));
bba3fe2 @stof Added a user provider
stof authored
42
43 if ($container->hasExtension('security')) {
44 $container->getExtension('security')->addUserProviderFactory(new EntityFactory('mongodb', 'doctrine.odm.mongodb.security.user.provider'));
45 }
9a8c63a @avalanche123 [DoctrineMongoDBBundle] switched to compiler passes for proxy/hydrator d...
avalanche123 authored
46 }
6f9a3aa @kriswallsmith changed yaml extension alias from "doctrine_mongo_db" to "doctrine_mongo...
kriswallsmith authored
47
48 public function getContainerExtension()
49 {
50 return new DoctrineMongoDBExtension();
51 }
22d95dd @fabpot [DoctrineMongoDBBundle] removed DoctrineMongoDBExtension constructor
fabpot authored
52 }
Something went wrong with that request. Please try again.