4
我試圖在silex框架上設置主義遷移。我通過作曲家安裝它。Doctrine Migrations命名空間錯誤
"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();
然而,當我運行遷移:狀態它輸出:
C:\htdocs\bitvenda\app>php console.php migrations:status
[Doctrine\DBAL\Migrations\MigrationException]
Migrations namespace must be configured in order to use Doctrine migrations
.
我做錯了嗎?
Dextervip,採取[這個其他看看問題] [1],它可能會解決你的問題。 [1]:http://stackoverflow.com/questions/10620794/doctrine-migrations-2-zend-framework-2-is-it-possibile – medina
@medina你說得對,我錯過了。謝謝。你知道是否有任何方法來設置配置文件的默認路徑? – dextervip
太棒了!我已經注意到你自己想通了..玩得開心! =) – medina