Created
January 4, 2013 16:30
-
-
Save anonymous/4453887 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ <?php /** * Displays the current migration version of the database * * @version 1.0 * @author Ain Tohvri <[email protected]> * @see sfBaseTask */ class currentMigrationVersionTask extends sfBaseTask { protected function configure() { $this->addOptions(array( new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'), )); $this->namespace = 'doctrine'; $this->name = 'current-migration-version'; $this->briefDescription = 'Display current migration version'; $this->detailedDescription = <<<EOF The [current-migration-version|INFO] displays the version of the current migration. Call it with: [php symfony doctrine:current-migration-version|INFO] EOF; } protected function execute($arguments = array(), $options = array()) { $databaseManager = new sfDatabaseManager($this->configuration); $connection = $databaseManager->getDatabase($options['connection'])->getConnection(); $migration = new Doctrine_Migration(dirname(__FILE__)); $this->logSection($this->name, $migration->getCurrentVersion()); } }