fix output file name

This commit is contained in:
Nathanael d. Noblet 2010-07-08 15:39:25 -06:00 committed by Fabien Potencier
parent 1bc973e5a9
commit b1b633cc71

View File

@ -80,6 +80,11 @@ EOT
$destPath .= '/Resources/config/doctrine/metadata';
}
// adjust so file naming works
if ($type === 'yaml') {
$type = 'yml';
}
$cme = new ClassMetadataExporter();
$exporter = $cme->getExporter($type);
@ -99,7 +104,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);
@ -109,4 +114,4 @@ EOT
$output->writeln('Database does not have any mapping information.'.PHP_EOL, 'ERROR');
}
}
}
}