Author: david
Date: Tue Aug 23 10:52:20 2011
New Revision: 9566

Log:
Don't update path if rename() fails

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

Modified: trunk/lib/task/migrate/QubitMigrate110.class.php
==============================================================================
--- trunk/lib/task/migrate/QubitMigrate110.class.php    Mon Aug 22 17:54:17 
2011        (r9565)
+++ trunk/lib/task/migrate/QubitMigrate110.class.php    Tue Aug 23 10:52:20 
2011        (r9566)
@@ -638,7 +638,11 @@
         {
           // Move assets
           $newpath = str_replace('uploads', 'uploads/r/'.$repo['slug'], 
$item2['path'].$item2['name']);
-          rename(sfConfig::get('sf_web_dir').$item2['path'].$item2['name'], 
sfConfig::get('sf_web_dir').$newpath);
+
+          if 
(!rename(sfConfig::get('sf_web_dir').$item2['path'].$item2['name'], 
sfConfig::get('sf_web_dir').$newpath))
+          {
+            continue; // If rename fails, don't update path
+          }
 
           // Update path
           $item2['path'] = $newpath;

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