Commit bf1a5251 authored by romanb's avatar romanb

[2.0] Fixed issue with file-based metadata drivers and the CLI.

parent 4fa4d7a8
......@@ -180,15 +180,15 @@ abstract class AbstractFileDriver implements Driver
*
* @return array The list of class names that have been preloaded.
*/
public function preload()
public function preload($force = false)
{
if ($this->_mode != self::PRELOAD) {
if ($this->_mode != self::PRELOAD && ! $force) {
return array();
}
foreach ((array)$this->_paths as $path) {
if (is_dir($path)) {
$files = glob($path . '/*' . $this->_fileExtension);
$files = glob($path . '/*');
foreach ($files as $file) {
$this->_elements = array_merge($this->_elements, $this->_loadMappingFile($file));
}
......
......@@ -52,7 +52,7 @@ class SchemaToolTask extends AbstractTask
{
$this->getPrinter()->write('schema-tool', 'KEYWORD');
$this->getPrinter()->writeln(
' --create | --drop | --update [--dump-sql] [--classdir=<path>]',
' (--create | --drop | --update) [--dump-sql] [--classdir=<path>]',
'INFO');
}
......@@ -126,8 +126,10 @@ class SchemaToolTask extends AbstractTask
}
}
} else {
$driver->preload();
$classes = $cmf->getLoadedMetadata();
$preloadedClasses = $driver->preload(true);
foreach ($preloadedClasses as $className) {
$classes[] = $cmf->getMetadataFor($className);
}
}
$printer = $this->getPrinter();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment