rossriley/doctrine-migrations-helper
Composer 安装命令:
composer require rossriley/doctrine-migrations-helper
包简介
Setup tool to provide configured Doctrine Migration Commands
README 文档
README
This package allows the setting up of the Doctrine CLI Tools with less Boilerplate and no Config Files.
You may want to use this if you prefer to initialise migrations from your own configuration / DI container rather than requiring an xml / yml migrations configuration file.
It depends on DBAL and must be initialised with a valid DriverConnection
Usage
The set is designed to be passed straight to a Symfony Console Application, usage may be as follows:
use DoctrineMigrationsHelper\CommandSet;
$set = new CommandSet($db_connection, $namespace, $directory);
$console->addCommands($set->getCommands());
The created configuration is available as a public property on the CommandSet so it can be manipulated in the same way as a normal Migrations configuration. For example:
use DoctrineMigrationsHelper\CommandSet;
$set = new CommandSet($db_connection);
$set->configuration->setMigrationsNamespace("Example\Namespace");
$console->addCommands($set->getCommands());
All standard CLI tools are setup by default, you can override this by manually setting the $set->commands array with your own set.
Additionally if your DI constructs a migrations configuration you can just overwrite the auto created one. For example:
$set = new CommandSet($container->get("db-connection"));
$set->configuration = $container->get("migrations");
$console->addCommands($set->getCommands());
统计信息
- 总下载量: 1.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-26