valorin/zf2-phinx-module
最新稳定版本:v0.1.1
Composer 安装命令:
composer require valorin/zf2-phinx-module
包简介
Integrates the Phinx database migration tool into a ZF2 application.
README 文档
README
Created by Stephen Rees-Carter, version 0.1.1.
ZF2 module to integrate the Phinx database migration tool into a ZF2 application console. It provides a way to sync the application DB connections with Phinx, and run each of the Phinx commands easily.
Installation
The easiest way to install the module is using Composer.
-
Install composer:
curl -s https://getcomposer.org/installer | php -
Add Phinx as a dependency to your
composer.jsonfile:./composer.phar require "valorin/zf2-phinx-module":"0.*" -
Update
./config/application.config.phpand add enable thePhinxModule:<?php return array( 'modules' => array( 'Application', // ... 'PhinxModule', ), );
-
Run the application console to see usage information:
valorin@gandalf ~/workspace/project $ php ./public/index.php ======================== = Your ZF2 Application = ======================== => Phinx v0.2.0 => Phinx module v0.1.1 Phinx module commands index.php phinx setup [--overwrite] Interactive Phinx setup wizard - will create both config files for you. index.php phinx sync Sync application database credentials with Phinx. index.php phinx List the Phinx console usage information. index.php phinx <phinx commands> Run the specified Phinx command (run 'phinx' for the commands list). --overwrite Will force the setup tool to run and overwrite any existing configuration. <phinx commands> Any support Phinx commands - will be passed through to Phinx as-is.
Commands
index.php phinx setup [--overwrite] - Interactive setup script that asks the user for the database credentials and
generates the ZF2 config file (./config/autoload/phinx.local.php) and the Phinx config file (./config/phinx.yml).
index.php phinx sync - Saves the database credentials found in the ZF2 config into the Phinx config file
(./config/phinx.yml) so you don't need to keep them both up-to-date.
index.php phinx <phinx commands> - Calls the Phinx cli and passes any specified phinx commands through to Phinx.
It also automatically configures the custom phinx.yml location so you don't need to worry about it.
Running this without any commands will return the Phinx command reference.
Composer Integration
The Phinx Module comes with support for Composer Scripts so you can have your application
database automatically set up and migrated as part of the composer install. Simply add the following block
to your composer.json, and it will automatically setup and migrate after a successful composer install
or composer update.
"scripts": {
"post-install-cmd": [
"PhinxModule\\Composer\\ScriptHandler::setup",
"PhinxModule\\Composer\\ScriptHandler::migrate"
],
"post-update-cmd": [
"PhinxModule\\Composer\\ScriptHandler::setup",
"PhinxModule\\Composer\\ScriptHandler::migrate"
]
}
All commands are optional, so only use what you need.
Version History
v0.1.1 - 2013-03-28
- Code refactoring and cleanup of setup and sync commands.
- Removed reliance on /vendor/bin dir.
v0.1.0 - 2013-03-03
- Added Interactive setup command.
- Added support for Composer Scripts.
valorin/zf2-phinx-module 适用场景与选型建议
valorin/zf2-phinx-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.29k 次下载、GitHub Stars 达 21, 最近一次更新时间为 2012 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zf2」 「module」 「phinx」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 valorin/zf2-phinx-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 valorin/zf2-phinx-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 valorin/zf2-phinx-module 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Phinx makes it ridiculously easy to manage the database migrations for your PHP app.
LosLog provides some log utility
Very simple SQL-based database migrations tool - a heavily stripped down fork of robmorgan/phinx
EdpModuleLayouts is very simple Laminas module for making module-specific layouts insanely easy.
Zend Framework module to leverage the symfony dependency injection container
Phinx integration for thinkphp
统计信息
- 总下载量: 5.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2012-12-12