Author: david
Date: Thu Aug 16 09:31:49 2012
New Revision: 12119

Log:
Restrict migrator to Release 1.1 v62.  Use standardized warning text if trying 
to migrate past v62.

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

Modified: trunk/lib/task/migrate/MigrateTask.class.php
==============================================================================
--- trunk/lib/task/migrate/MigrateTask.class.php        Thu Aug 16 00:02:58 
2012        (r12118)
+++ trunk/lib/task/migrate/MigrateTask.class.php        Thu Aug 16 09:31:49 
2012        (r12119)
@@ -28,7 +28,15 @@
 class MigrateTask extends sfBaseTask
 {
   const
-    FINAL_VERSION = 75;
+    FINAL_VERSION = 62,
+    NOTICE_FINAL_VERSION = <<<EOL
+
+Notice: This migration script will only migrate your data to version Release 
1.1 v%s.
+To migrate to Release 1.2 or later, please see the upgrading documentation:
+
+http://qubit-toolkit.org/wiki/index.php?title=Upgrading
+
+EOL;
 
   protected
     $data,
@@ -92,15 +100,9 @@
 
     if (self::FINAL_VERSION <= $this->initialVersion)
     {
-      $this->logBlock(array(
-        '',
-        sprintf('ERROR: This migration script will only migrate your data to 
version Release 1.2 v%s.', self::FINAL_VERSION),
-        'To migrate to Release 1.3 or later, please see the upgrading 
documentation:',
-        '',
-        'http://qubit-toolkit.org/wiki/index.php?title=Upgrading',
-        '',
-        'Exiting!',
-        ''), 'ERROR');
+      $this->logBlock(array_merge(
+        explode("\n", sprintf(self::NOTICE_FINAL_VERSION, 
self::FINAL_VERSION)),
+        array('Exiting.', '')), 'ERROR');
 
       return 1;
     }
@@ -120,17 +122,13 @@
         return 1;
       }
 
-      // Version 75 is the last valid version for this migration script
+      // Version 62 is the last valid version for this migration script
       if (self::FINAL_VERSION < intval($options['target-version']))
       {
-        if (!$this->askConfirmation(array(
-          sprintf('WARNING: This migration script will only migrate your data 
to version Release 1.2 v%s', self::FINAL_VERSION),
-          'To migrate to Release 1.3 or later, please see upgrading 
documentation:',
-          '',
-          'http://qubit-toolkit.org/wiki/index.php?title=Upgrading',
-          '',
-          sprintf('Do you want to proceed with migrating your data to version 
%s (Y/n)?', self::FINAL_VERSION)
-          ), 'QUESTION_LARGE'))
+        if (!$this->askConfirmation(array_merge(
+          explode("\n", sprintf(self::NOTICE_FINAL_VERSION, 
self::FINAL_VERSION)),
+          array(sprintf('Do you want to proceed with migrating your data to 
version %s (Y/n)?', self::FINAL_VERSION), '')),
+          'QUESTION_LARGE'))
         {
           $this->log('Halting migration.');
 

-- 
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