[2.0] Fixed issue with file-based metadata drivers and the CLI.
This commit is contained in:
parent
4fa4d7a8ca
commit
bf1a52517d
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user