dir; } /** add a file to the working copy */ abstract function addFile($path); /** removes a file from the working copy */ abstract function delFile($path); /** commit changes that are pending in the working copy */ abstract function commit($CS); /** get an MTrackSCMFile representation of a file */ abstract function getFile($path); /** enumerates files in a path in the working copy */ function enumFiles($path) { return scandir($this->dir . DIRECTORY_SEPARATOR . $path); } /** determines if a file exists in the working copy */ function file_exists($path) { return file_exists($this->dir . DIRECTORY_SEPARATOR . $path); } function __destruct() { if (strlen($this->dir) > 1) { require_once 'System.php'; //System::rm('-r', $this->dir); } } function generateTempDir() { $tn = '/var/lib/php5/mtrackworkingdirlEwD96'; if (file_exists($tn)) { echo "TRASH"; require_once 'System.php'; System::rm('-rf', $tn); } clearstatcache(); if (file_exists($tn)) { die("OOPS"); } return $tn; $tn = tempnam(ini_get('session.save_path'),'mtrackworkingdir'); unlink($tn); return $tn; } }