Przeglądaj źródła

[DoctrineBundle] changed mapping directory

From Resources/config/ to Resources/config/doctrine
From doctrine.orm.dcm.xml to mapping.orm.dcm.xml
Fabien Potencier 14 lat temu
rodzic
commit
d9299e930b
15 zmienionych plików z 23 dodań i 23 usunięć
  1. 4 4
      UPDATE.md
  2. 1 1
      src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php
  3. 1 1
      src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php
  4. 1 1
      src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php
  5. 1 1
      src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php
  6. 1 1
      src/Symfony/Bundle/DoctrineBundle/Mapping/Driver/XmlDriver.php
  7. 1 1
      src/Symfony/Bundle/DoctrineBundle/Mapping/Driver/YamlDriver.php
  8. 4 4
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php
  9. 0 0
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/Fixtures.Bundles.XmlBundle.Entity.Test.orm.dcm.xml
  10. 0 0
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine/Fixtures.Bundles.YamlBundle.Entity.Test.orm.dcm.yml
  11. 2 2
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_multiple_em_bundle_mappings.xml
  12. 2 2
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml
  13. 2 2
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_multiple_em_bundle_mappings.yml
  14. 2 2
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml
  15. 1 1
      src/Symfony/Bundle/DoctrineBundle/Tests/TestCase.php

+ 4 - 4
UPDATE.md

@@ -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`

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php

@@ -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();

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php

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

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php

@@ -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.'
             );
         }
 

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php

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

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Mapping/Driver/XmlDriver.php

@@ -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';
 

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Mapping/Driver/YamlDriver.php

@@ -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';
 

+ 4 - 4
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php

@@ -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')
         ));
     }
 

src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/Fixtures.Bundles.XmlBundle.Entity.Test.orm.dcm.xml → src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/Fixtures.Bundles.XmlBundle.Entity.Test.orm.dcm.xml


src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/Fixtures.Bundles.YamlBundle.Entity.Test.orm.dcm.yml → src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine/Fixtures.Bundles.YamlBundle.Entity.Test.orm.dcm.yml


+ 2 - 2
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_multiple_em_bundle_mappings.xml

@@ -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>

+ 2 - 2
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml

@@ -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>

+ 2 - 2
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_multiple_em_bundle_mappings.yml

@@ -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

+ 2 - 2
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml

@@ -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

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Tests/TestCase.php

@@ -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',
                     )
                 )