function getList($path, $revs = null) {
if(substr($path,0,1)=='/') $path = substr($path,1);
if(strpos($path,'..')!==false) return;
$command = sprintf(
'%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
);
$buff = $this->execCmd($command, $error);
// 운영체제 별 줄바꿈 문자 처리가 틀리므로 \n으로 통일시키기
$buff = str_replace(array("\r\n", "\r"), "\n", $buff);
$list = explode("\n",$buff);
if(!count($list)) return null;
$file_list = $directory_list = $output = array();
foreach($list as $name) {
if(!$name) continue;
$obj = null;
$obj->name = $name;
$obj->path = $path.$name;
$logs = $this->getLog($obj->path, $revs, null, false, 1);
$obj->revision = $logs[0]->revision;
$obj->author = $logs[0]->author;
$obj->date = $this->getDateStr("Y-m-d H:i",$logs[0]->date);
$obj->gap = $this->getTimeGap($logs[0]->date);
$obj->msg = $this->linkXE($logs[0]->msg);
if(substr($obj->path,-1)=='/') $obj->type = 'directory';
else $obj->type = 'file';
if($obj->type == 'file') $file_list[] = $obj;
else $directory_list[] = $obj;
}
return array_merge($directory_list, $file_list);
}태그목록
첨부파일 목록