Added 7.4 to travis.yml.

Fixed a bug where not all request headers were available when running under apache server.
This commit is contained in:
Joe Ginley 2020-02-03 22:44:09 -05:00
parent 645bcf227c
commit 2eaa8c8697
2 changed files with 12 additions and 6 deletions

View File

@ -2,6 +2,7 @@ language: php
php:
- "7.2"
- "7.3"
- "7.4"
before_script:
- composer selfupdate

View File

@ -479,14 +479,19 @@ class ServerRequest extends Request implements ServerRequestInterface
*/
protected function getServerRequestHeaders()
{
// http://www.php.net/manual/en/function.getallheaders.php#84262
$headers = array();
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) === "HTTP_") {
$headers[str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($name, 5)))))] = $value;
if (!function_exists('apache_get_version')) {
// http://www.php.net/manual/en/function.getallheaders.php#84262
$headers = array();
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) === "HTTP_") {
$headers[str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($name, 5)))))] = $value;
}
}
return $headers;
}
else {
return apache_request_headers();
}
return $headers;
}
/**