1
0
Fork 0
Go to file
Eve Rogez 48684bc692 Correction on error message 2013-10-09 10:20:01 +02:00
lib/Doctrine/ODM/MongoDB/Migrations Correction on error message 2013-10-09 10:20:01 +02:00
tests Updated the composer.json and converted the testsuite to composer 2012-09-19 22:43:02 +02:00
.gitignore Updated the composer.json and converted the testsuite to composer 2012-09-19 22:43:02 +02:00
.travis.yml Updated the composer.json and converted the testsuite to composer 2012-09-19 22:43:02 +02:00
LICENSE Preparing migrations for distribution. 2010-06-09 14:07:50 -04:00
README.markdown Fixed documentation URL 2012-09-07 16:47:29 +02:00
build.properties.dev Refactoring Configuration (and tests), and build 2011-02-15 22:20:07 +01:00
build.xml Refactoring Configuration (and tests), and build 2011-02-15 22:20:07 +01:00
composer.json Convert DBAL migration tool to MongoDB 2013-08-22 23:30:34 +02:00
package.php Convert DBAL migration tool to MongoDB 2013-08-22 23:30:34 +02:00
phar-cli-stub.php Convert DBAL migration tool to MongoDB 2013-08-22 23:30:34 +02:00
phpunit.xml.dist Updated the composer.json and converted the testsuite to composer 2012-09-19 22:43:02 +02:00

README.markdown

Doctrine Database Migrations

Eric Clemmons' Modifications

The latest official PHAR had path issues for me, so I made a couple of modifications and made packaging a bit easier, especially when creating a custom PHAR for your own apps.

Download doctrine-migrations.phar with custom Input/Output CLI support

Modifications

  • Added DiffCommand for migrations.
  • Support for custom ArgvInput in CLI instance
  • Support for custom ConsoleOutput in CLI instance

In the same way that Doctrine will attempt to load the return values from migrations-db.php as your connection parameters, you can have migrations-input.php return:

$input = new \Symfony\Component\Console\Input\ArgvInput;
... make some changes ...
return $input;

or have migrations-output.php return a customized ConsoleOutput with support for HTML tags in your SQL statements:

$output = new \Symfony\Component\Console\Output\ConsoleOutput;
$output->setStyle('p');
return $output;

This should give you the flexibility you need for customizing your input/output in the CLI.

Building Your Phar

Simply run php package.php, which will create the file: build/doctrine-migrations.phar for you. Done! :) This is a bit simpler than getting Phing/Ant going and running phing build-migrations and hoping the rest of the build dependencies work.

Creating archive disabled by INI setting

If you receive an error that looks like:

creating archive "build/doctrine-migrations.phar" disabled by INI setting

This can be fixed by setting the following in your php.ini:

; http://php.net/phar.readonly
phar.readonly = Off

Installing Dependencies

To install dependencies issue the following commands:

git submodule init
git submodule update

Official Documentation

All available documentation can be found here.