svnpeer.php
复制代码 代码如下:
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;
}
}
http://www.bkjia.com/phpjc/324524.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/324524.htmltecharticlesvnpeer.php 复制代码 代码如下: ?php /** * * this class for execute the external program of svn * * @auth seven yang qineer@gmail.com * */ class svnpeer { /** * list director...