|
1 # Doctrine Database Migrations |
|
2 |
|
3 ## Eric Clemmons' Modifications |
|
4 |
|
5 The latest official PHAR had path issues for me, so I made a couple of modifications and made |
|
6 packaging a bit easier, especially when creating a custom PHAR for your own apps. |
|
7 |
|
8 [Download `doctrine-migrations.phar` with custom Input/Output CLI support](http://github.com/downloads/ericclemmons/migrations/doctrine-migrations.phar) |
|
9 |
|
10 ### Modifications |
|
11 |
|
12 * Added `DiffCommand` for migrations. |
|
13 * Support for custom `ArgvInput` in CLI instance |
|
14 * Support for custom `ConsoleOutput` in CLI instance |
|
15 |
|
16 In the same way that Doctrine will attempt to load the return values from `migrations-db.php` as your |
|
17 connection parameters, you can have `migrations-input.php` return: |
|
18 |
|
19 $input = new \Symfony\Component\Console\Input\ArgvInput; |
|
20 ... make some changes ... |
|
21 return $input; |
|
22 |
|
23 or have `migrations-output.php` return a customized `ConsoleOutput` with support for HTML tags in |
|
24 your SQL statements: |
|
25 |
|
26 $output = new \Symfony\Component\Console\Output\ConsoleOutput; |
|
27 $output->setStyle('p'); |
|
28 return $output; |
|
29 |
|
30 This should give you the flexibility you need for customizing your input/output in the CLI. |
|
31 |
|
32 ### Building Your Phar |
|
33 |
|
34 Simply run `php package.php`, which will create the file: `build/doctrine-migrations.phar` for you. |
|
35 Done! :) This is a bit simpler than getting Phing/Ant going and running `phing build-migrations` and |
|
36 hoping the rest of the build dependencies work. |
|
37 |
|
38 ### Creating archive disabled by INI setting |
|
39 |
|
40 If you receive an error that looks like: |
|
41 |
|
42 creating archive "build/doctrine-migrations.phar" disabled by INI setting |
|
43 |
|
44 This can be fixed by setting the following in your php.ini: |
|
45 |
|
46 ; http://php.net/phar.readonly |
|
47 phar.readonly = Off |
|
48 |
|
49 ### Installing Dependencies |
|
50 |
|
51 To install dependencies issue the following commands: |
|
52 |
|
53 git submodule init |
|
54 git submodule update |
|
55 |
|
56 ## Official Documentation |
|
57 |
|
58 All available documentation can be found [here](http://www.doctrine-project.org/projects/migrations/2.0/docs/en). |