public function pull()
{
$rowData = file_get_contents(‘php://input’, ‘r’);得到参数
r
o
w
D
a
t
a
=
j
s
o
n
d
e
c
o
d
e
(
rowData = json_decode(
rowData=jsondecode(rowData,true);
file_put_contents(‘auto.php’, var_export($rowData,TRUE), FILE_APPEND);
//var_dump($num);die;
if(isset($rowData['project']) && isset($rowData['project']['name']) && $rowData['project']['name']){
file_put_contents(auto_pull.sh, 'cd /www/html/front_dist; git pull');
system(auto_pull.sh);拉取文件,注意文件权限777
echo 'success';
}else{
echo 'error';
}
}