创星网络[分享知识 传递快乐]
标题:
PHP通过浏览器执行SVN UP代码到服务器
[打印本页]
作者:
luinstein
时间:
2012-10-12 05:46
标题:
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/
欢迎光临 创星网络[分享知识 传递快乐] (http://bbs.cxweb.com.cn/)
Powered by Discuz! X3