diff --git a/modules/issuetracker/classes/svn.class.php b/modules/issuetracker/classes/svn.class.php index ed24280a7..7cacf7068 100644 --- a/modules/issuetracker/classes/svn.class.php +++ b/modules/issuetracker/classes/svn.class.php @@ -10,6 +10,8 @@ var $svn_cmd = null; + var $tmp_dir = '/tmp'; + var $oXml = null; var $userid = null; var $passwd = null; @@ -21,6 +23,9 @@ if(strstr($svn_cmd, " ") != FALSE) $this->svn_cmd = '"'.$svn_cmd.'"' ; else $this->svn_cmd = $svn_cmd; + $this->tmp_dir = _XE_PATH_.'files/cache/tmp'; + if(!is_dir($this->tmp_dir)) FileHandler::makeDir($this->tmp_dir); + $this->userid = $userid; $this->passwd = $passwd; @@ -43,7 +48,7 @@ if(substr($path,0,1)=='/') $path = substr($path,1); if(strpos($path,'..')!==false) return; - $command = sprintf("%s --non-interactive log --xml --limit 1 %s %s%s", $this->svn_cmd, $this->_getAuthInfo(), $this->url, $path); + $command = sprintf("%s --non-interactive --config-dir %s log --xml --limit 1 %s %s%s", $this->svn_cmd, $this->tmp_dir, $this->_getAuthInfo(), $this->url, $path); $buff = $this->execCmd($command, $error); $xmlDoc = $this->oXml->parse($buff); @@ -63,9 +68,10 @@ if(strpos($path,'..')!==false) return; $command = sprintf( - '%s --non-interactive %s list %s%s%s', + '%s --non-interactive %s --config-dir %s list %s%s%s', $this->svn_cmd, $this->_getAuthInfo(), + $this->tmp_dir, $this->url, $path, $revs?'@'.(int)$revs:null @@ -104,9 +110,10 @@ if(strpos($path,'..')!==false) return; $command = sprintf( - '%s --non-interactive %s cat %s%s%s', + '%s --non-interactive %s --config-dir %s cat %s%s%s', $this->svn_cmd, $this->_getAuthInfo(), + $this->tmp_dir, $this->url, $path, $revs?'@'.$revs:null @@ -197,16 +204,17 @@ function getComp($path, $brev, $erev) { if(!$brev) { - $command = sprintf('%s --non-interactive %s log --xml --limit 2 %s%s@%d', $this->svn_cmd, $this->_getAuthInfo(), $this->url, $path, $erev); + $command = sprintf('%s --non-interactive %s --config-dir %s log --xml --limit 2 %s%s@%d', $this->svn_cmd, $this->_getAuthInfo(), $this->tmp_dir, $this->url, $path, $erev); $buff = $this->execCmd($command, $error); $xmlDoc = $this->oXml->parse($buff); $brev = $xmlDoc->log->logentry[1]->attrs->revision; if(!$brev) return; } - $command = sprintf('%s --non-interactive %s diff %s%s@%d %s%s@%d', + $command = sprintf('%s --non-interactive %s --config-dir %s diff %s%s@%d %s%s@%d', $this->svn_cmd, $this->_getAuthInfo(), + $this->tmp_dir, $this->url, $path, $brev, @@ -225,9 +233,10 @@ if(strpos($path,'..')!==false) return; $command = sprintf( - '%s --non-interactive %s log --xml %s %s %s %s%s', + '%s --non-interactive %s --config-dir %s log --xml %s %s %s %s%s', $this->svn_cmd, $this->_getAuthInfo(), + $this->tmp_dir, $quiet?'--quiet':'--verbose', $limit?'--limit '.$limit:'', $erev>0?(sprintf('-r%d:%d',(int)$erev, (int)$brev)):'',