我正在尝试在Silex框架上设置Doctrine迁移。我通过Composer安装了它。
"doctrine/dbal": "2.3.*",
"doctrine/migrations": "dev-master",
我的控制台文件:
...
$app['composer_loader']->add('Doctrine\DBAL\Migrations', __DIR__.'/../vendor/doctrine/migrations/lib/');
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
"db" => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($app['db']),
"dialog" => new \Symfony\Component\Console\Helper\DialogHelper(),
));
$console->setHelperSet($helperSet);
$console->addCommands(array(
// Migrations Commands
new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand()
));
$console->run();
然而当我运行migrations:status命令时,它输出:
C:\htdocs\bitvenda\app>php console.php migrations:status
[Doctrine\DBAL\Migrations\MigrationException]
Migrations namespace must be configured in order to use Doctrine migrations
.
我做错了什么?