Author: sevein
Date: Tue Jul 24 15:05:04 2012
New Revision: 11974

Log:
Add -v (verbose option), use sort_by_name() to make sure that files are sort by 
name (causing errors in some installations)

Modified:
   trunk/lib/task/migrate/arUpgradeSqlTask.class.php

Modified: trunk/lib/task/migrate/arUpgradeSqlTask.class.php
==============================================================================
--- trunk/lib/task/migrate/arUpgradeSqlTask.class.php   Tue Jul 24 14:57:17 
2012        (r11973)
+++ trunk/lib/task/migrate/arUpgradeSqlTask.class.php   Tue Jul 24 15:05:04 
2012        (r11974)
@@ -55,6 +55,7 @@
       new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 
'The environment', 'cli'),
       new sfCommandOption('connection', null, 
sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),
       new sfCommandOption('no-backup', 'B', sfCommandOption::PARAMETER_NONE, 
'Don\'t backup database', null),
+      new sfCommandOption('verbose', 'v', sfCommandOption::PARAMETER_NONE, 
'Verbose mode', null),
     ));
   }
 
@@ -122,7 +123,11 @@
     // Find all the upgrade classes in lib/task/migrate
     $version = $this->initialVersion;
 
-    foreach 
(sfFinder::type('file')->maxdepth(0)->name('arUpgrader*.class.php')->in(sfConfig::get('sf_lib_dir').'/task/migrate')
 as $filename)
+    foreach (sfFinder::type('file')
+              ->maxdepth(0)
+              ->sort_by_name()
+              ->name('arUpgrader*.class.php')
+              ->in(sfConfig::get('sf_lib_dir').'/task/migrate') as $filename)
     {
       $className = preg_replace('/.*(arUpgrader\d+).*/', '$1', $filename);
       $class = new $className;
@@ -136,7 +141,7 @@
       {
         $this->logSection('upgrade-sql', sprintf('Upgrading from Release %s', 
$class::MILESTONE));
 
-        while ($class->up($version, $this->configuration))
+        while ($class->up($version, $this->configuration, $options))
         {
           // Update version in database
           $sql = 'UPDATE setting_i18n SET value = ? WHERE id = (SELECT id FROM 
setting WHERE name = ?);';

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to