luinstein 发表于 2012-10-12 05:46:53

PHP通过浏览器执行SVN UP代码到服务器

部分代码:$arg_file = '/var/args';
function update($file)
{
      global $svn_user,$svn_pass,$arg_file;
      exec("svn up --username $svn_user --password $svn_pass $file 2>&1 <$arg_file", $output);
      echo "更新成功的列表";
      echo "<pre>";
      foreach ($output as $val) {
                printf($val);
                echo "
";
      }
      echo "</pre>";
      submit($_POST['file']);
}主要功能:
      1.带登录认证,支持多用户
      2. 检查修改过或存在或已冲突的文件,防止更新产生冲突
      问题解答:1.You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' 修改/etc/subversion/servers在globals段里添加一行
      store-plaintext-passwords = yes
      2.如提示.svn文件夹没有写权限,请使用chmod赋予权限。
      3. /var/args文件需要手动创建,如有需要也可改为其它路径。
      参考:
      http://blog.s135.com/post/371/
      http://koda.iteye.com/blog/1086240
svnup.111018.rar(1.64 K)

from:http://blog.linuxphp.org/archives/1375/
页: [1]
查看完整版本: PHP通过浏览器执行SVN UP代码到服务器