您好,欢迎访问一九零五行业门户网

php操作SVN类

使用php完成svn的操作,包括复制,查看列表,删除,移动,创建目录,查看diff,更新,合并,提交,获取状态,获取commit log,获取当前版本号操作。在svn 1.6.11版本中测试通过。
entry[0]->attributes() as $key=>$value){
if ('revision' == $key) {
return $value;
}
}
}
static public function getheadrevision($path)
{
$command = cd $path && svn up;
$output = svnpeer::runcmd($command);
$output = implode('
', $output);
preg_match_all(/[0-9]+/, $output, $ret);
if (!$ret[0][0]){
return
. $command .
. $output;
}
return $ret[0][0];
}
/**
* run a cmd and return result
*
* @param string command line
* @param boolen true need add the svn authentication
* @return array the contents of the output that svn execute
*/
static protected function runcmd($command)
{
$authcommand = ' --username ' . svn_username . ' --password ' . svn_password . ' --no-auth-cache --non-interactive --config-dir '.svn_config_dir.'.subversion';
exec($command . $authcommand . 2>&1, $output);
return $output;
}
}
其它类似信息

推荐信息