Skip to content

Commit 6318bef

Browse files
Merge pull request #5 from 7twin/php-fpm-fix
Fixed not existing getallheaders() on PHP-FPM
2 parents 90ac08a + e399154 commit 6318bef

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

deploy.php

+12
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ function endScript() {
164164
// The branch
165165
$branch = '';
166166

167+
if (!function_exists('getallheaders')) {
168+
function getallheaders() {
169+
$headers = [];
170+
foreach ($_SERVER as $name => $value) {
171+
if (substr($name, 0, 5) == 'HTTP_') {
172+
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
173+
}
174+
}
175+
return $headers;
176+
}
177+
}
178+
167179
// Process request headers
168180
$headers = getallheaders();
169181
if(isset($headers['X-Event-Key'])) {

0 commit comments

Comments
 (0)