git_pull이 CLI에서도 동작하게 변경

This commit is contained in:
2019-09-22 23:15:29 +09:00
parent 0b4ef0e333
commit 4bfa257b02
+11 -2
View File
@@ -24,10 +24,14 @@ function getVersion($target=null){
}
function isCommandLineInterface()
{
return (php_sapi_name() === 'cli');
}
header('Content-Type: application/json');
$req_hash = $_REQUEST['req']??'';
$req_time = $_REQUEST['time']??0;
$json_response = [
'result'=>false,
@@ -35,6 +39,10 @@ $json_response = [
'version'=>null,
];
if (!isCommandLineInterface()) {
$req_hash = $_REQUEST['req']??'';
$req_time = $_REQUEST['time']??0;
if (!$req_hash) {
$json_response['reason'] = 'no req';
die(json_encode($json_response));
@@ -63,6 +71,7 @@ if($ans_hash != $req_hash){
$json_response['reason'] = 'hash mismatch';
die(json_encode($json_response));
}
}
exec("git pull -q 2>&1", $output);