瀏覽代碼

Fixing issue with .xml being hardcoded and converting yaml to yml for propert file extension.

Jonathan H. Wage 15 年之前
父節點
當前提交
dbc5249f88
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php

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

@@ -75,6 +75,9 @@ EOT
         } else {
             $destPath .= '/Resources/config/doctrine/metadata';
         }
+        if ($type === 'yaml') {
+            $type = 'yml';
+        }
 
         $cme = new ClassMetadataExporter();
         $exporter = $cme->getExporter($type);
@@ -100,7 +103,7 @@ EOT
                 if ($type === 'annotation') {
                     $path = $destPath.'/'.$className.'.php';
                 } else {
-                    $path = $destPath.'/'.str_replace('\\', '.', $class->name).'.dcm.xml';
+                    $path = $destPath.'/'.str_replace('\\', '.', $class->name).'.dcm.'.$type;
                 }
                 $output->writeln(sprintf('  > writing <comment>%s</comment>', $path));
                 $code = $exporter->exportClassMetadata($class);