if (isset($this->cache['branches'])) {␊ |
return $this->cache['branches'];␊ |
}␊ |
$res = array();␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --username=%s --password=%s %s@HEAD',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
|
/**␊ |
* Get latest changes.␊ |
*␊ |
* @param string Commit ('HEAD').␊ |
* @param string Revision or ('HEAD').␊ |
* @param int Number of changes (10).␊ |
*␊ |
* @return array Changes.␊ |
*/␊ |
public function getChangeLog($rev='HEAD', $n=10)␊ |
{␊ |
if ($rev != 'HEAD' and !preg_match('/^\d+$/', $rev)) {␊ |
// we accept only revisions or HEAD␊ |
$rev = 'HEAD';␊ |
}␊ |
$res = array();␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml -v --limit %s --username=%s --password=%s %s@%s',␊ |
escapeshellarg($n),␊ |
|
escapeshellarg($rev));␊ |
$xmlRes = shell_exec($cmd);␊ |
$xml = simplexml_load_string($xmlRes);␊ |
␊ |
$res = array();␊ |
foreach ($xml->logentry as $entry) {␊ |
$log = array();␊ |
$log['author'] = (string) $entry->author;␊ |
|
␊ |
$res[] = (object) $log;␊ |
}␊ |
␊ |
return $res;␊ |
}␊ |
␊ |