Skip to content

Commit

Permalink
Merge pull request #5 from 7twin/php-fpm-fix
Browse files Browse the repository at this point in the history
Fixed not existing getallheaders() on PHP-FPM
  • Loading branch information
rubenreyes2000 authored Nov 6, 2018
2 parents 90ac08a + e399154 commit 6318bef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ function endScript() {
// The branch
$branch = '';

if (!function_exists('getallheaders')) {
function getallheaders() {
$headers = [];
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}

// Process request headers
$headers = getallheaders();
if(isset($headers['X-Event-Key'])) {
Expand Down

0 comments on commit 6318bef

Please sign in to comment.