[DoctrineBundle] changed mapping directory

From Resources/config/ to Resources/config/doctrine
From doctrine.orm.dcm.xml to mapping.orm.dcm.xml
This commit is contained in:
Fabien Potencier 2011-05-05 17:58:35 +02:00
parent 3f69333acb
commit d9299e930b
15 changed files with 23 additions and 23 deletions

View File

@ -13,8 +13,8 @@ beta1 to beta2
is now managed directly by Symfony SE in ``AppKernel``.
* The Doctrine metadata files has moved from
``Resources/config/doctrine/metadata/orm/`` to ``Resources/config/`` and the
extension from ``.dcm.yml`` to ``.orm.dcm.yml``
``Resources/config/doctrine/metadata/orm/`` to ``Resources/config/doctrine``
and the extension from ``.dcm.yml`` to ``.orm.dcm.yml``
Before:
@ -23,8 +23,8 @@ beta1 to beta2
After:
Resources/config/Bundle.Entity.orm.dcm.xml
Resources/config/Bundle.Entity.orm.dcm.yml
Resources/config/doctrine/Bundle.Entity.orm.dcm.xml
Resources/config/doctrine/Bundle.Entity.orm.dcm.yml
* With the introduction of a new Doctrine Registry class, the following
parameters have been removed (replaced by methods on the `doctrine`

View File

@ -103,7 +103,7 @@ EOT
$mappingPath = $mappingCode = false;
} else {
$mappingType = 'yaml' == $mappingType ? 'yml' : $mappingType;
$mappingPath = $bundle->getPath().'/Resources/config/'.str_replace('\\', '.', $fullEntityClassName).'.orm.dcm.'.$mappingType;
$mappingPath = $bundle->getPath().'/Resources/config/doctrine/'.str_replace('\\', '.', $fullEntityClassName).'.orm.dcm.'.$mappingType;
$mappingCode = $exporter->exportClassMetadata($class);
$entityGenerator = $this->getEntityGenerator();

View File

@ -58,7 +58,7 @@ EOT
if ('annotation' === $type) {
$destPath .= '/Entity';
} else {
$destPath .= '/Resources/config';
$destPath .= '/Resources/config/doctrine';
}
if ('yaml' === $type) {
$type = 'yml';

View File

@ -60,7 +60,7 @@ EOT
'You do not have any mapped Doctrine ORM entities for any of your bundles. '.
'Create a class inside the Entity namespace of any of your bundles and provide '.
'mapping information for it with Annotations directly in the classes doc blocks '.
'or with XML/YAML in your bundles Resources/config directory.'
'or with XML/YAML in your bundles Resources/config/doctrine/ directory.'
);
}

View File

@ -315,7 +315,7 @@ class DoctrineExtension extends AbstractDoctrineExtension
protected function getMappingResourceConfigDirectory()
{
return 'Resources/config';
return 'Resources/config/doctrine';
}
/**

View File

@ -20,7 +20,7 @@ use Doctrine\ORM\Mapping\Driver\XmlDriver as BaseXmlDriver;
*/
class XmlDriver extends BaseXmlDriver
{
protected $_globalFile = 'doctrine';
protected $_globalFile = 'mapping';
protected $_classCache;
protected $_fileExtension = '.orm.dcm.xml';

View File

@ -20,7 +20,7 @@ use Doctrine\ORM\Mapping\Driver\YamlDriver as BaseYamlDriver;
*/
class YamlDriver extends BaseYamlDriver
{
protected $_globalFile = 'doctrine';
protected $_globalFile = 'mapping';
protected $_classCache;
protected $_fileExtension = '.orm.dcm.yml';

View File

@ -554,12 +554,12 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
$ymlDef = $container->getDefinition('doctrine.orm.default_yml_metadata_driver');
$this->assertDICConstructorArguments($ymlDef, array(
array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'YamlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config')
array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'YamlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'doctrine')
));
$xmlDef = $container->getDefinition('doctrine.orm.default_xml_metadata_driver');
$this->assertDICConstructorArguments($xmlDef, array(
array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'XmlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config')
array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'XmlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'doctrine')
));
}
@ -602,12 +602,12 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
$ymlDef = $container->getDefinition('doctrine.orm.em2_yml_metadata_driver');
$this->assertDICConstructorArguments($ymlDef, array(
array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'YamlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config')
array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'YamlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'doctrine')
));
$xmlDef = $container->getDefinition('doctrine.orm.em2_xml_metadata_driver');
$this->assertDICConstructorArguments($xmlDef, array(
array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'XmlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config')
array(__DIR__ .DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'Bundles'.DIRECTORY_SEPARATOR.'XmlBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'doctrine')
));
}

View File

@ -16,9 +16,9 @@
<mapping name="AnnotationsBundle" />
</entity-manager>
<entity-manager name="em2">
<mapping name="YamlBundle" dir="Resources/config" alias="yml" />
<mapping name="YamlBundle" dir="Resources/config/doctrine" alias="yml" />
<mapping name="manual" type="xml" prefix="Fixtures\Bundles\XmlBundle"
dir="%kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config"
dir="%kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine"
alias="TestAlias"
/>
</entity-manager>

View File

@ -13,9 +13,9 @@
<orm>
<mapping name="AnnotationsBundle" />
<mapping name="YamlBundle" dir="Resources/config" alias="yml" />
<mapping name="YamlBundle" dir="Resources/config/doctrine" alias="yml" />
<mapping name="manual" type="xml" prefix="Fixtures\Bundles\XmlBundle"
dir="%kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config"
dir="%kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine"
alias="TestAlias"
/>
</orm>

View File

@ -14,10 +14,10 @@ doctrine:
em2:
mappings:
YamlBundle:
dir: Resources/config
dir: Resources/config/doctrine
alias: yml
manual:
type: xml
prefix: Fixtures\Bundles\XmlBundle
dir: %kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config
dir: %kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine
alias: TestAlias

View File

@ -9,10 +9,10 @@ doctrine:
mappings:
AnnotationsBundle: ~
YamlBundle:
dir: Resources/config
dir: Resources/config/doctrine
alias: yml
manual:
type: xml
prefix: Fixtures\Bundles\XmlBundle
dir: %kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config
dir: %kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine
alias: TestAlias

View File

@ -77,7 +77,7 @@ class TestCase extends \PHPUnit_Framework_TestCase
'default' => array(
'mappings' => array('YamlBundle' => array(
'type' => 'yml',
'dir' => __DIR__ . "/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config",
'dir' => __DIR__ . "/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine",
'prefix' => 'Fixtures\Bundles\YamlBundle',
)
)