定制 mdantas/phinx-wrapper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固