3 abstract class MTrack_SCM_WorkingCopy {
6 /** returns the root dir of the working copy */
11 /** add a file to the working copy */
12 abstract function addFile($path);
13 /** removes a file from the working copy */
14 abstract function delFile($path);
15 /** commit changes that are pending in the working copy */
16 abstract function commit($CS);
17 /** get an MTrackSCMFile representation of a file */
18 abstract function getFile($path);
20 /** enumerates files in a path in the working copy */
21 function enumFiles($path)
23 return scandir($this->dir . DIRECTORY_SEPARATOR . $path);
26 /** determines if a file exists in the working copy */
27 function file_exists($path)
29 return file_exists($this->dir . DIRECTORY_SEPARATOR . $path);
34 if (strlen($this->dir) > 1) {
35 require_once 'System.php';
36 //System::rm('-r', $this->dir);
39 function generateTempDir()
42 $tn = '/var/lib/php5/mtrackworkingdirlEwD96';
43 if (file_exists($tn)) {
45 require_once 'System.php';
46 var_dump(System::rm('-rf', $tn));
49 if (file_exists($tn)) {
54 $tn = tempnam(ini_get('session.save_path'),'mtrackworkingdir');