Skip to content
This repository

Allow overriding migration template #67

Open
wants to merge 1 commit into from

3 participants

Kevin Bond Ivan Zgoniaiko Alexander Volochnev
Kevin Bond
kbond commented April 19, 2012

No description provided.

Kevin Bond kbond referenced this pull request in kbond/ZenstruckMigrationsBundle April 19, 2012
Open

wrapper for doctrine:migrations:diff command #1

Ivan Zgoniaiko

I'd like to see this pull merged.

for now I have to override property $_template and method generateMigration() for change template.

Alexander Volochnev

Useful feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 19, 2012
Kevin Bond Allow overriding migration template 249eba8
This page is out of date. Refresh to see the latest.
4  lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php
@@ -38,7 +38,7 @@
38 38
 class GenerateCommand extends AbstractCommand
39 39
 {
40 40
 
41  
-    private static $_template =
  41
+    protected static $_template =
42 42
             '<?php
43 43
 
44 44
 namespace <namespace>;
@@ -109,7 +109,7 @@ protected function generateMigration(Configuration $configuration, InputInterfac
109 109
             $up ? "        " . implode("\n        ", explode("\n", $up)) : null,
110 110
             $down ? "        " . implode("\n        ", explode("\n", $down)) : null
111 111
         );
112  
-        $code = str_replace($placeHolders, $replacements, self::$_template);
  112
+        $code = str_replace($placeHolders, $replacements, static::$_template);
113 113
         $dir = $configuration->getMigrationsDirectory();
114 114
         $dir = $dir ? $dir : getcwd();
115 115
         $dir = rtrim($dir, '/');
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.