Skip to content

Commit

Permalink
[DoctrineBundle] changed mapping file suffix from .orm.dcm.yml to .or…
Browse files Browse the repository at this point in the history
…m.yml
  • Loading branch information
fabpot committed May 6, 2011
1 parent 0cdd6ca commit dfd5b65
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions UPDATE.md
Expand Up @@ -14,7 +14,7 @@ beta1 to beta2

* The Doctrine metadata files has moved from
``Resources/config/doctrine/metadata/orm/`` to ``Resources/config/doctrine``
and the extension from ``.dcm.yml`` to ``.orm.dcm.yml``
and the extension from ``.dcm.yml`` to ``.orm.yml``

Before:

Expand All @@ -23,8 +23,8 @@ beta1 to beta2

After:

Resources/config/doctrine/Bundle.Entity.orm.dcm.xml
Resources/config/doctrine/Bundle.Entity.orm.dcm.yml
Resources/config/doctrine/Bundle.Entity.orm.xml
Resources/config/doctrine/Bundle.Entity.orm.yml

* With the introduction of a new Doctrine Registry class, the following
parameters have been removed (replaced by methods on the `doctrine`
Expand Down
Expand Up @@ -263,11 +263,11 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container)
}
$container->addResource(new FileResource($resource));

if (($files = glob($dir.'/'.$configPath.'/*.orm.dcm.xml')) && count($files)) {
if (($files = glob($dir.'/'.$configPath.'/*.orm.xml')) && count($files)) {
return 'xml';
} elseif (($files = glob($dir.'/'.$configPath.'/*.orm.dcm.yml')) && count($files)) {
} elseif (($files = glob($dir.'/'.$configPath.'/*.orm.yml')) && count($files)) {
return 'yml';
} elseif (($files = glob($dir.'/'.$configPath.'/*.orm.dcm.php')) && count($files)) {
} elseif (($files = glob($dir.'/'.$configPath.'/*.orm.php')) && count($files)) {

This comment has been minimized.

Copy link
@ornicar

ornicar May 6, 2011

Contributor

You just introduced the word orm in a bundle meant to be "Abstract". It won't deal nicely with other Doctrine flavors.

This comment has been minimized.

Copy link
@ornicar

ornicar May 6, 2011

Contributor

In fact, orm has been introduced before: b7c8442#L1L266

This comment has been minimized.

Copy link
@stof

stof May 6, 2011

Member

The extension should be taken from a method defined in each bundle (just like the path). Currently, this breaks the ODM as it requires the .orm part when the bundle uses the old location.

This comment has been minimized.

Copy link
@stof

stof May 6, 2011

Member

See #813

return 'php';
}

Expand Down
Expand Up @@ -103,7 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$mappingPath = $mappingCode = false;
} else {
$mappingType = 'yaml' == $mappingType ? 'yml' : $mappingType;
$mappingPath = $bundle->getPath().'/Resources/config/doctrine/'.str_replace('\\', '.', $fullEntityClassName).'.orm.dcm.'.$mappingType;
$mappingPath = $bundle->getPath().'/Resources/config/doctrine/'.str_replace('\\', '.', $fullEntityClassName).'.orm.'.$mappingType;
$mappingCode = $exporter->exportClassMetadata($class);

$entityGenerator = $this->getEntityGenerator();
Expand Down
Expand Up @@ -89,9 +89,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$className = $class->name;
$class->name = $bundle->getNamespace().'\\Entity\\'.$className;
if ('annotation' === $type) {
$path = $destPath.'/'.$className.'.orm.dcm.php';
$path = $destPath.'/'.$className.'.orm.php';
} else {
$path = $destPath.'/'.str_replace('\\', '.', $class->name).'.orm.dcm.'.$type;
$path = $destPath.'/'.str_replace('\\', '.', $class->name).'.orm.'.$type;
}
$output->writeln(sprintf(' > writing <comment>%s</comment>', $path));
$code = $exporter->exportClassMetadata($class);
Expand Down
Expand Up @@ -22,7 +22,7 @@ class XmlDriver extends BaseXmlDriver
{
protected $_globalFile = 'mapping';
protected $_classCache;
protected $_fileExtension = '.orm.dcm.xml';
protected $_fileExtension = '.orm.xml';

public function isTransient($className)
{
Expand Down
Expand Up @@ -22,7 +22,7 @@ class YamlDriver extends BaseYamlDriver
{
protected $_globalFile = 'mapping';
protected $_classCache;
protected $_fileExtension = '.orm.dcm.yml';
protected $_fileExtension = '.orm.yml';

public function isTransient($className)
{
Expand Down

0 comments on commit dfd5b65

Please sign in to comment.