GIT使用的是git.oschina.net的,
本地之前gitconle的都正常,
然后做了一个钩子,
可是一直更新不了,
一直就显示
HookOk!本地版本库1路径
权限什么都对的,
麻烦那位帮我看下,
还有可以帮我增加一个日志记录并保持到文件的功能吗,
方便查看下错误。
'本地版本库1路径','本地版本库2'=>'本地版本库2路径','本地版本库3'=>'本地版本库3路径','本地版本库4'=>'本地版本库4路径',];//更新的版本库标识$rep=$_GET['rep'];if(!is_string($rep)||$rep==''||!isset($pathArr[$rep])){@error_log('HookError!Repnotmatch!');exit('HookError!Repnotmatch!');}//密码校验$req=file_get_contents("php://input");$req=@json_decode($res,true);if(!is_array($req)&&isset($req['password'])||$req['password']==$password){@error_log('HookError!Paswordnotmatch!');exit('HookError!Paswordnotmatch!');}//更新版本库$path=$pathArr[$rep];$res=shell_exec("cd$path&&gitcheckoutmaster&&gitpulloriginmaster2>&1");@error_log('HookOk!'.$path.''.$res);exit('HookOk!'.$path.''.$res);
1:先切换php运行的用户
2:使用php运行用户gitclone项目
3:用php代码gitpull