function isDir($path) { if (!isset($this->dircache[dirname($path)])) { echo "SVN:LS " . $this->repos . dirname($path) . "\n"; $p = strlen(dirname($path)) > 1 ? dirname($path) : ''; $this->dircache[dirname($path)] = svn_ls($this->repos . $p, $this->rev); } $ar = $this->dircache[dirname($path)]; //print_r($ar); $match = basename($path); foreach ($ar as $info) { if ($info['name'] != $match) { continue; } return $info['type'] == 'dir'; } return false; }
} function populate_encoding(){ alert("Free"); if(type_cat_all.checked){ alert("Free"); categorie.disable; } if(type_cat_free.checked){ alert("mlkjklj"); n = categorie_libre.length; type_cat_fixed.checked=false; <?php $cat_list = svn_ls($url . '/trunk/' . $langue . '/Free'); echo '<select id=categorie name=categorie[] onChange="populate_encoding()">'; foreach ($cat_list as $iter => $name) { echo "<option value=" . $iter . ">" . $iter . "</option>\n"; } echo "</select>"; ?> alert("Free"); for (i=0; i<n; i++) { category_id.options.add(categorie_libre[i]); }//fin for } if(type_cat_fixed.checked){ type_cat_free.checked=false; alert("fixed");
function getDirList($path, $rev = null) { return svn_ls($this->mRepoPath . $path, $this->_rev($rev, SVN_REVISION_HEAD)); }
#Need to install pecl svn #sudo apt-get install libsvn-dev #sudo pecl install svn #echo "extension=svn.so" > /etc/php5/apache2/conf.d/svn.ini $root = 'http://svn.apache.org/repos/asf/subversion/'; //svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_USERNAME, 'username'); //svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, 'name'); $dir = '/'; if (!empty($_GET['dir'])) { $dir = $_GET['dir']; if ($dir[0] == '/') { $dir = '.' . $dir . '/'; } } $return = $dirs = $fi = array(); $files = svn_ls($root . $dir); // All dirs foreach ($files as $key => $file) { if ($file['type'] == 'dir') { $dirs[] = array('type' => $file['type'], 'dir' => '', 'file' => $key); } else { $fi[] = array('type' => $file['type'], 'dir' => '', 'file' => $key, 'ext' => getExt($key)); } $return = array_merge($dirs, $fi); } echo json_encode($return); function getExt($file) { $dot = strrpos($file, '.') + 1; return substr($file, $dot); }
public function get_tags() { $tags = array_keys(svn_ls($this->repo_path . 'tags')); natsort($tags); return $tags; }
/** * List repository content at a given revision * * @access public * @author Cédric Alfonsi, <*****@*****.**> * @param Repository vcs * @param string path * @param int revision * @return array */ public function listContent(core_kernel_versioning_Repository $vcs, $path, $revision = null) { $returnValue = array(); $startTime = helpers_Time::getMicroTime(); if ($vcs->authenticate()) { $svnList = svn_ls($path, $revision); foreach ($svnList as $svnEntry) { $returnValue[] = array('name' => $svnEntry['name'], 'type' => $svnEntry['type'], 'revision' => $svnEntry['created_rev'], 'author' => $svnEntry['last_author'], 'time' => $svnEntry['time_t']); } } $endTime = helpers_Time::getMicroTime(); common_Logger::i("svn_listContent (" . $path . ') -> ' . ($endTime - $startTime) . 's'); return (array) $returnValue; }
protected function svnLs($svnUri, $revision = SVN_REVISION_HEAD, $recurse = false) { return svn_ls($svnUri, $revision, $recurse); }