2017 © Pedro Peláez
 

library zf2-phinx-module

Integrates the Phinx database migration tool into a ZF2 application.

image

valorin/zf2-phinx-module

Integrates the Phinx database migration tool into a ZF2 application.

  • Saturday, May 11, 2013
  • by valorin
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3,782 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 7 % Grown

The README.md

ZF2 Phinx Module

Created by Stephen Rees-Carter, version 0.1.1. ![Build Status][travis-img], (*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., (*2)

Installation

The easiest way to install the module is using Composer., (*3)

  1. Install composer:, (*4)

    curl -s https://getcomposer.org/installer | php
    
  2. Add Phinx as a dependency to your composer.json file:, (*5)

    ./composer.phar require "valorin/zf2-phinx-module":"0.*"
    
  3. Update ./config/application.config.php and add enable the PhinxModule:, (*6)

    <?php
    return array(
        'modules' => array(
            'Application',
            // ...
            'PhinxModule',
        ),
    );
    
  4. Run the application console to see usage information:, (*7)

    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)., (*8)

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., (*9)

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., (*10)

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., (*11)

"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., (*12)

Version History

v0.1.1 - 2013-03-28 - Code refactoring and cleanup of setup and sync commands. - Removed reliance on /vendor/bin dir., (*13)

v0.1.0 - 2013-03-03 - Added Interactive setup command. - Added support for Composer Scripts., (*14)

The Versions

11/05 2013

dev-master

9999999-dev https://github.com/valorin/zf2-phinx-module

Integrates the Phinx database migration tool into a ZF2 application.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 module phinx

28/03 2013

v0.1.1

0.1.1.0 https://github.com/valorin/zf2-phinx-module

Integrates the Phinx database migration tool into a ZF2 application.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 module phinx

02/03 2013

v0.1.0

0.1.0.0 https://github.com/valorin/zf2-phinx-module

Integrates the Phinx database migration tool into a ZF2 application.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 module phinx

03/02 2013

v0.0.3

0.0.3.0 https://github.com/valorin/zf2-phinx-module

Integrates the Phinx database migration tool into a ZF2 application.

  Sources   Download

BSD-3-Clause

The Requires

 

zf2 module phinx

12/12 2012

0.0.2

0.0.2.0 https://github.com/valorin/zf2-phinx-module

Integrates the Phinx database migration tool into a ZF2 application.

  Sources   Download

BSD-3-Clause

The Requires

 

zf2 module phinx

12/12 2012

0.0.1

0.0.1.0 https://github.com/valorin/zf2-phinx-module

Integrates the Phinx database migration tool into a ZF2 application.

  Sources   Download

BSD-3-Clause

The Requires

 

zf2 module phinx