private function get_webhook_data()
{
$request_body = file_get_contents('php://input');
$request_data = json_decode($request_body, true);
if (empty($request_data)) {
return false;
}
// GitHub
if ('push' == $_SERVER['HTTP_X_GITHUB_EVENT']) {
return $this->parse_github_webhook($request_data);
}
// Bitbucket
if ('repo:push' == $_SERVER['HTTP_X_EVENT_KEY']) {
return $this->parse_bitbucket_webhook($request_data);
}
// GitLab
if ('Push Hook' == $_SERVER['HTTP_X_GITLAB_EVENT']) {
return $this->parse_gitlab_webhook($request_data);
}
return false;
}