1
0
mirror of synced 2024-12-13 22:56:04 +03:00

Merge pull request #235 from holtkamp/patch-1

Allow ExporterDrivers that implement the exportClassMetadata() function to return false
This commit is contained in:
Benjamin Eberlei 2011-12-27 23:54:09 -08:00
commit e5cf1da4ee

View File

@ -111,16 +111,18 @@ abstract class AbstractExporter
}
foreach ($this->_metadata as $metadata) {
$output = $this->exportClassMetadata($metadata);
$path = $this->_generateOutputPath($metadata);
$dir = dirname($path);
if ( ! is_dir($dir)) {
mkdir($dir, 0777, true);
//In case output is returned, write it to a file, skip otherwise
if($output = $this->exportClassMetadata($metadata)){
$path = $this->_generateOutputPath($metadata);
$dir = dirname($path);
if ( ! is_dir($dir)) {
mkdir($dir, 0777, true);
}
if (file_exists($path) && !$this->_overwriteExistingFiles) {
throw ExportException::attemptOverwriteExistingFile($path);
}
file_put_contents($path, $output);
}
if (file_exists($path) && !$this->_overwriteExistingFiles) {
throw ExportException::attemptOverwriteExistingFile($path);
}
file_put_contents($path, $output);
}
}