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: php:
- "7.2" - "7.2"
- "7.3" - "7.3"
- "7.4"
before_script: before_script:
- composer selfupdate - composer selfupdate

View File

@ -479,6 +479,7 @@ class ServerRequest extends Request implements ServerRequestInterface
*/ */
protected function getServerRequestHeaders() protected function getServerRequestHeaders()
{ {
if (!function_exists('apache_get_version')) {
// http://www.php.net/manual/en/function.getallheaders.php#84262 // http://www.php.net/manual/en/function.getallheaders.php#84262
$headers = array(); $headers = array();
foreach ($_SERVER as $name => $value) { foreach ($_SERVER as $name => $value) {
@ -488,6 +489,10 @@ class ServerRequest extends Request implements ServerRequestInterface
} }
return $headers; return $headers;
} }
else {
return apache_request_headers();
}
}
/** /**
* @param array $root * @param array $root