MTrack/SCM/WorkingCopy.php
authorAlan Knowles <alan@akbkhome.com>
Tue, 6 Sep 2011 10:02:43 +0000 (18:02 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 6 Sep 2011 10:02:43 +0000 (18:02 +0800)
MTrack/SCM/WorkingCopy.php

index 171bfad..df9f596 100644 (file)
@@ -33,17 +33,26 @@ abstract class MTrack_SCM_WorkingCopy {
     {
         if (strlen($this->dir) > 1) {
             require_once 'System.php';
+            
             //System::rm('-r', $this->dir);
         }
     }
+    
+    function rmdir($dir) {
+        require_once 'System.php';
+        $rm = System::which('rm');
+        $cmd = "$rm -rf " . escapeshellarg($dir);
+        `$cmd`;
+        
+        
+    }
+    
     function generateTempDir()
     {
         
         $tn =  '/var/lib/php5/mtrackworkingdirlEwD96a';
         if (file_exists($tn)) {
-            echo "TRASH";
-            require_once 'System.php';
-            var_dump(System::rm('-rf', $tn));
+            $this->rmdir($tn);
         }
         clearstatcache();
         if (file_exists($tn)) {