Skip to content

Loading…

Allow overriding migration template #67

Closed
wants to merge 1 commit into from

4 participants

@kbond

No description provided.

@kbond kbond referenced this pull request in kbond/ZenstruckMigrationsBundle
Open

wrapper for doctrine:migrations:diff command #1

@zgoniaiko

I'd like to see this pull merged.

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

@HadesArchitect

Useful feature

@mikeSimonson

@kbond Can you explain why you want to extend the generateCommand instead of the AbstractCommand ?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 19, 2012
  1. @kbond
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php
View
4 lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php
@@ -38,7 +38,7 @@
class GenerateCommand extends AbstractCommand
{
- private static $_template =
+ protected static $_template =
'<?php
namespace <namespace>;
@@ -109,7 +109,7 @@ protected function generateMigration(Configuration $configuration, InputInterfac
$up ? " " . implode("\n ", explode("\n", $up)) : null,
$down ? " " . implode("\n ", explode("\n", $down)) : null
);
- $code = str_replace($placeHolders, $replacements, self::$_template);
+ $code = str_replace($placeHolders, $replacements, static::$_template);
$dir = $configuration->getMigrationsDirectory();
$dir = $dir ? $dir : getcwd();
$dir = rtrim($dir, '/');
Something went wrong with that request. Please try again.