From 8463f92bf949ca2ff163006958b7fe9e03958f49 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 6 Sep 2011 18:02:43 +0800 Subject: [PATCH] MTrack/SCM/WorkingCopy.php --- MTrack/SCM/WorkingCopy.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/MTrack/SCM/WorkingCopy.php b/MTrack/SCM/WorkingCopy.php index 171bfad2..df9f5960 100644 --- a/MTrack/SCM/WorkingCopy.php +++ b/MTrack/SCM/WorkingCopy.php @@ -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)) { -- 2.39.2