Download the PHP package valorin/zf2-phinx-module without Composer
On this page you can find all versions of the php package valorin/zf2-phinx-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download valorin/zf2-phinx-module
More information about valorin/zf2-phinx-module
Files in valorin/zf2-phinx-module
Package zf2-phinx-module
Short Description Integrates the Phinx database migration tool into a ZF2 application.
License BSD-3-Clause
Homepage https://github.com/valorin/zf2-phinx-module
Informations about the package zf2-phinx-module
ZF2 Phinx Module
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:
-
Add Phinx as a dependency to your
composer.json
file: -
Update
./config/application.config.php
and add enable thePhinxModule
: - Run the application console to see usage information:
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
.
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.