Permalink
Browse files

Rename doctrine.odm.mongodb to doctrine_mongodb.odm

  • Loading branch information...
henrikbjorn committed Jul 24, 2012
1 parent aa03541 commit 66c5f0d31ec5f85994144014ff0024dbfa74b40f
View
@@ -7,15 +7,20 @@ in 2.1 minor versions.
2.1.0
-----
+### Services
+
+ * The id for referencing the registry have been changed from `doctrine.odm.mongodb`
+ to `doctrine_mongodb`.
+
### Events
* The format for naming event manager services is now
- `doctrine.odm.mongodb.%s_connection.event_manager` and uses the connection
+ `doctrine_mongodb.odm.%s_connection.event_manager` and uses the connection
name. The event manager shared by the default document manager is still
- aliased as `doctrine.odm.mongodb.event_manager`.
+ aliased as `doctrine_mongodb.odm.event_manager`.
* Listeners and subscriber services must be tagged with
- `doctrine.odm.mongodb.event_listener` and
- `doctrine.odm.mongodb.event_subscriber`, respectively. By default, listeners
+ `doctrine_mongodb.odm.event_listener` and
+ `doctrine_mongodb.odm.event_subscriber`, respectively. By default, listeners
and subscribers will be registered with event managers for all connections,
unless the `connection` attribute is specified.
* Added `lazy` attribute to tags to request lazy loading of listener services
@@ -54,7 +54,7 @@ public function isOptional()
public function warmUp($cacheDir)
{
// we need the directory no matter the hydrator cache generation strategy.
- $hydratorCacheDir = $this->container->getParameter('doctrine.odm.mongodb.hydrator_dir');
+ $hydratorCacheDir = $this->container->getParameter('doctrine_mongodb.odm.hydrator_dir');
if (!file_exists($hydratorCacheDir)) {
if (false === @mkdir($hydratorCacheDir, 0777, true)) {
throw new \RuntimeException(sprintf('Unable to create the Doctrine Hydrator directory (%s)', dirname($hydratorCacheDir)));
@@ -64,16 +64,16 @@ public function warmUp($cacheDir)
}
// if hydrators are autogenerated we don't need to generate them in the cache warmer.
- if ($this->container->getParameter('doctrine.odm.mongodb.auto_generate_hydrator_classes') === true) {
+ if ($this->container->getParameter('doctrine_mongodb.odm.auto_generate_hydrator_classes') === true) {
return;
}
/* @var $registry \Doctrine\Common\Persistence\ManagerRegistry */
- $registry = $this->container->get('doctrine.odm.mongodb');
+ $registry = $this->container->get('doctrine_mongodb');
foreach ($registry->getManagers() as $dm) {
/* @var $dm \Doctrine\ODM\MongoDB\DocumentManager */
$classes = $dm->getMetadataFactory()->getAllMetadata();
$dm->getHydratorFactory()->generateHydratorClasses($classes);
}
}
-}
+}
@@ -54,7 +54,7 @@ public function isOptional()
public function warmUp($cacheDir)
{
// we need the directory no matter the proxy cache generation strategy.
- $proxyCacheDir = $this->container->getParameter('doctrine.odm.mongodb.proxy_dir');
+ $proxyCacheDir = $this->container->getParameter('doctrine_mongodb.odm.proxy_dir');
if (!file_exists($proxyCacheDir)) {
if (false === @mkdir($proxyCacheDir, 0777, true)) {
throw new \RuntimeException(sprintf('Unable to create the Doctrine Proxy directory (%s)', dirname($proxyCacheDir)));
@@ -64,16 +64,16 @@ public function warmUp($cacheDir)
}
// if proxies are autogenerated we don't need to generate them in the cache warmer.
- if ($this->container->getParameter('doctrine.odm.mongodb.auto_generate_proxy_classes') === true) {
+ if ($this->container->getParameter('doctrine_mongodb.odm.auto_generate_proxy_classes') === true) {
return;
}
/* @var $registry \Doctrine\Common\Persistence\ManagerRegistry */
- $registry = $this->container->get('doctrine.odm.mongodb');
+ $registry = $this->container->get('doctrine_mongodb');
foreach ($registry->getManagers() as $dm) {
/* @var $dm \Doctrine\ODM\MongoDB\DocumentManager */
$classes = $dm->getMetadataFactory()->getAllMetadata();
$dm->getProxyFactory()->generateProxyClasses($classes);
}
}
-}
+}
@@ -30,7 +30,7 @@
{
public static function setApplicationDocumentManager(Application $application, $dmName)
{
- $dm = $application->getKernel()->getContainer()->get('doctrine.odm.mongodb')->getManager($dmName);
+ $dm = $application->getKernel()->getContainer()->get('doctrine_mongodb')->getManager($dmName);
$helperSet = $application->getHelperSet();
$helperSet->set(new DocumentManagerHelper($dm), 'dm');
}
@@ -49,7 +49,7 @@ protected function getDocumentGenerator()
protected function getDoctrineDocumentManagers()
{
- return $this->getContainer()->get('doctrine.odm.mongodb')->getManagers();
+ return $this->getContainer()->get('doctrine_mongodb')->getManagers();
}
protected function getBundleMetadatas(Bundle $bundle)
@@ -49,10 +49,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$documentManagerName = $input->getOption('dm') ?
$input->getOption('dm') :
- $this->getContainer()->get('doctrine.odm.mongodb')->getDefaultManagerName();
+ $this->getContainer()->get('doctrine_mongodb')->getDefaultManagerName();
/* @var $documentManager Doctrine\ODM\MongoDB\DocumentManager */
- $documentManager = $this->getContainer()->get('doctrine.odm.mongodb')->getManager($documentManagerName);
+ $documentManager = $this->getContainer()->get('doctrine_mongodb')->getManager($documentManagerName);
$documentClassNames = $documentManager->getConfiguration()
->getMetadataDriverImpl()
@@ -56,7 +56,7 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
- $dm = $this->getContainer()->get('doctrine.odm.mongodb')->getManager($input->getOption('dm'));
+ $dm = $this->getContainer()->get('doctrine_mongodb')->getManager($input->getOption('dm'));
$dirOrFile = $input->getOption('fixtures');
if ($dirOrFile) {
$paths = is_array($dirOrFile) ? $dirOrFile : array($dirOrFile);
@@ -44,7 +44,7 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
- $dm = $this->getContainer()->get('doctrine.odm.mongodb.document_manager');
+ $dm = $this->getContainer()->get('doctrine_mongodb.odm.document_manager');
$repository = $dm->getRepository($input->getArgument('document'));
$repositoryReflection = new \ReflectionClass($repository);
$documentReflection = $repository->getDocumentManager()->getMetadataFactory()->getMetadataFor($input->getArgument('document'))->getReflectionClass();
@@ -21,15 +21,15 @@ class CreateHydratorDirectoryPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
- if (!$container->hasParameter('doctrine.odm.mongodb.hydrator_dir')) {
+ if (!$container->hasParameter('doctrine_mongodb.odm.hydrator_dir')) {
return;
}
// Don't do anything if auto_generate_hydrator_classes is false
- if (!$container->getParameter('doctrine.odm.mongodb.auto_generate_hydrator_classes')) {
+ if (!$container->getParameter('doctrine_mongodb.odm.auto_generate_hydrator_classes')) {
return;
}
// Create document proxy directory
- $hydratorCacheDir = $container->getParameter('doctrine.odm.mongodb.hydrator_dir');
+ $hydratorCacheDir = $container->getParameter('doctrine_mongodb.odm.hydrator_dir');
if (!is_dir($hydratorCacheDir)) {
if (false === @mkdir($hydratorCacheDir, 0777, true)) {
exit(sprintf('Unable to create the Doctrine Hydrator directory (%s)', dirname($hydratorCacheDir)));
@@ -21,15 +21,15 @@ class CreateProxyDirectoryPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
- if (!$container->hasParameter('doctrine.odm.mongodb.proxy_dir')) {
+ if (!$container->hasParameter('doctrine_mongodb.odm.proxy_dir')) {
return;
}
// Don't do anything if auto_generate_proxy_classes is false
- if (!$container->getParameter('doctrine.odm.mongodb.auto_generate_proxy_classes')) {
+ if (!$container->getParameter('doctrine_mongodb.odm.auto_generate_proxy_classes')) {
return;
}
// Create document proxy directory
- $proxyCacheDir = $container->getParameter('doctrine.odm.mongodb.proxy_dir');
+ $proxyCacheDir = $container->getParameter('doctrine_mongodb.odm.proxy_dir');
if (!is_dir($proxyCacheDir)) {
if (false === @mkdir($proxyCacheDir, 0777, true)) {
exit(sprintf('Unable to create the Doctrine Proxy directory (%s)', dirname($proxyCacheDir)));
Oops, something went wrong.

0 comments on commit 66c5f0d

Please sign in to comment.