Author: sevein
Date: Sun Oct 16 00:57:27 2011
New Revision: 10119

Log:
Clean files after import

Modified:
   trunk/plugins/qtSwordPlugin/lib/qtPackageExtractor.class.php

Modified: trunk/plugins/qtSwordPlugin/lib/qtPackageExtractor.class.php
==============================================================================
--- trunk/plugins/qtSwordPlugin/lib/qtPackageExtractor.class.php        Sun Oct 
16 00:42:29 2011        (r10118)
+++ trunk/plugins/qtSwordPlugin/lib/qtPackageExtractor.class.php        Sun Oct 
16 00:57:27 2011        (r10119)
@@ -187,7 +187,32 @@
 
   public function clean()
   {
-    // unlink()...
+    unlink($this->filename);
+
+    $rrmdir = function($directory) use (&$rrmdir)
+    {
+      $objects = scandir($directory);
+
+      foreach ($objects as $object)
+      {
+        if ($object != '.' && $object != '..')
+        {
+          if (filetype($directory.'/'.$object) == 'dir')
+          {
+            $rrmdir($directory."/".$object);
+          }
+          else
+          {
+            unlink($directory."/".$object);
+          }
+        }
+      }
+
+      reset($objects);
+      rmdir($directory);
+    };
+
+    $rrmdir($this->directory);
   }
 
   protected function getMainDmdSec()

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