mdantas/phinx-wrapper
Composer 安装命令:
composer require mdantas/phinx-wrapper
包简介
This package simply phinx configuration by passing env vars to commands or base you app console to inject config by constructor.
README 文档
README
No have another library to manage migrations easily and simple like phinx, and i make this package to easily phinx commands or application console, is intention are you can add commands to your application console or use bin/phinxwrap by environments vars or inject Phinx\Config\Config to constructor of each command.
install
composer require mdantas/phinx-wrapper //For generate env file, this not overwrite you env file. vendor/bin/phinxwrap init_env
requirements
phinx 0.10.6
Environment example
DATABASE_MIGRATIONS_PATH=%%PHINX_CONFIG_DIR%%/db/migrations DATABASE_SEEDS_PATH=%%PHINX_CONFIG_DIR%%/db/seeds DATABASE_VERSION=creation DATABASE_STAGE=development DATABASE_ADAPTER=mysql DATABASE_NAME=development_db DATABASE_USER=root DATABASE_PASSWORD= DATABASE_HOST=localhost DATABASE_PORT=3306 DATABASE_CHARSET=utf8
Examples
//In your app.php //Config read from env or inject any place you need. $config = \mdantas\PhinxWrap\PhinxConfiguration::envToConfigInterface(__DIR__.'/../') $application = new \mdantas\PhinxWrap\ConsoleApplication( $config );
public function __construct(\Phinx\Config\ConfigInterface $config) { $this->addCommands([ new Create($config), new Status($config), new Migrate($config), new Rollback($config), new SeedCreate($config), new SeedRun($config), new Test($config), ]); }
Note
All phinx commands are based on package Symfony Console.
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-19