He probado ya , y salta el siguiente error:
Fatal error: Uncaught exception 'Doctrine\DBAL\DBALException' with message 'Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.
Y los datos de la conexion son correctos...
Este es mi cli-config.php:
Código PHP:
require_once LIB_PATH.'Doctrine/Common/ClassLoader.php';
$classLoader = new DoctrineCommonClassLoader('Application\Models', dirname(dirname(dirname(__FILE__))));
$classLoader->register();
$classLoader = new DoctrineCommonClassLoader('Application\Models\Proxies', dirname(dirname(dirname(__FILE__))));
$classLoader->register();
$config = new DoctrineORMConfiguration();
$cache = new DoctrineCommonCacheArrayCache();
$config->setMetadataCacheImpl($cache);
$driverImpl = $config -> newDefaultAnnotationDriver(dirname(dirname(dirname(__FILE__))) . '/../application/models');
$config->setMetadataDriverImpl($driverImpl);
$config->setProxyDir(dirname(dirname(dirname(__FILE__))) . '/../application/models/proxies');
$config->setProxyNamespace('Application\Models\Proxies');
/*$connectionOptions = array(
'driver' => 'pdo_mysql',
'path' => dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, array('data', 'db', 'database-dev.db'))
);*/
$connectionOptions = array(
'dbname' => 'BaseDatos',
'user' => 'base',
'password' => 'datos',
'host' => 'test.es',
'driver' => 'pdo_mysql',
);
$em = DoctrineORMEntityManager::create($connectionOptions, $config);
$sm = $em->getConnection()->getSchemaManager();
$em->getConfiguration()->setMetadataDriverImpl(
new DoctrineORMMappingDriverDatabaseDriver(
$em->getConnection()->getSchemaManager()
)
);
$cmf = new DoctrineORMToolsDisconnectedClassMetadataFactory($em);
$cmf->setEntityManager($em);
$metadata = $cmf->getAllMetadata();
$cme = new DoctrineORMToolsExportClassMetadataExporter();
$exporter = $cme->getExporter('yml', dirname(dirname(dirname(__FILE__))) . '/../application/schema');
$exporter->setMetadata($metadata);
$etg = new DoctrineORMToolsEntityGenerator;
$exporter->setEntityGenerator($etg);
$exporter->export();
$helperSet = new SymfonyComponentConsoleHelperHelperSet(array(
'db' => new DoctrineDBALToolsConsoleHelperConnectionHelper($em->getConnection()),
'em' => new DoctrineORMToolsConsoleHelperEntityManagerHelper($em)
));
Un saludo