Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compiler pass for bundles to register mappings #185

Merged
merged 4 commits into from
May 15, 2013
Merged

Add compiler pass for bundles to register mappings #185

merged 4 commits into from
May 15, 2013

Conversation

dbu
Copy link
Member

@dbu dbu commented Apr 17, 2013

use the compiler pass added to the doctrine bridge to provide a nice compiler pass for bundles. See symfony/symfony#7599 and doctrine/DoctrineBundle#177

documentation PR is at symfony/symfony-docs#2507

this is used for example in FriendsOfSymfony/FOSUserBundle#1081

public static function createAnnotationMappingDriver(array $namespaces, array $directories, $enabledParameter = false)
{
$arguments = array(new Reference('doctrine_mongodb.odm.metadata.annotation_reader'), $directories);
$locator = new Definition('Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator', $arguments);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong (same than in the doctrineBundle)

@stof
Copy link
Member

stof commented Apr 19, 2013

StaticPHPDriver should also be supported (the whole driver lives in Common. The ORM only has a BC child class with no extra logic in it)

@jmikola
Copy link
Member

jmikola commented Apr 19, 2013

Cross-referencing with the DoctrineBundle PR: doctrine/DoctrineBundle#177

@dbu
Copy link
Member Author

dbu commented Apr 24, 2013

i added support for php and staticphp drivers now by copying the definition creation code - its too small to make it worth to abstract it. this PR is now at the same state as the one on doctrine orm

@dbu
Copy link
Member Author

dbu commented May 4, 2013

the doc PR about this is now merged: symfony/symfony-docs#2507

in doctrine/DoctrineBundle#177 i don't know if anything is still open or if its just not merged yet. tried to get the attention of stof and beberlei several times but they seem busy.

@dbu
Copy link
Member Author

dbu commented May 5, 2013

doctrine orm is now merged too. anything left to do here?

<?php

/*
* This file is part of the Doctrine Bundle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong

@dbu
Copy link
Member Author

dbu commented May 10, 2013

fixed the doc issue stof noticed, removed unnecessary use and alias.

* @param bool $enabledParameter if specified, the compiler pass only
* executes if this parameter exists in the service container.
*/
public function __construct($driver, $namespaces, $managerParameters, $enabledParameter = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this.

@jmikola jmikola merged commit 211233a into doctrine:master May 15, 2013
@jmikola
Copy link
Member

jmikola commented May 15, 2013

@dbu: Thanks for your work on this. I merged this to master and made my small correction in 2779745.

@dbu
Copy link
Member Author

dbu commented May 15, 2013

great, thanks a lot.

@jmikola jmikola changed the title add compiler pass for bundles to register mappings Add compiler pass for bundles to register mappings May 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants