Support example:
class hook { public function handle($receiver_path) { $filename = basename($receiver_path, '.php'); $api_key = "'';// ваш api_key $postData = file_get_contents('php://input'); if (strlen($postData) > 0) { $decodedData = json_decode($postData, true); if ($decodedData == '') { $decodedData = json_decode(gzdecode($postData), true); } $hash = $decodedData['auth']; $decodedData['auth'] = $api_key; file_put_contents('/tmp/__'.$filename. '__' .time(). '.log', var_export($decodedData, true) . "nn Hash received: {$hash}n Hash verifying: " .md5(json_encode($decodedData))); } else { $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_U RI]"; file_put_contents('/tmp/GET__'.$filename. '__' .time(). '.log', $actual_link, FILE_APPEND); echo 'Yep! It works! Filename: '.$filename; } } }
From it it is visible that the empty hook can come.
It is also likely on older versions, since we do not receive a leader with multi-part / form-data, it may be that the input is empty: https://stackoverflow.com/a/20148962/5892568
Therefore, it may possibly help: http://php.net/manual/en/ini.core.php#ini.enable-post-data-reading
When this option is disabled, the superglobal variables $ _POST and $ _FILES will not be populated. The only way to read the POST data is to read the stream wrapper php: // input. This can be useful when proxying requests or processing POST data in a way that uses memory more efficiently.