public static function all()
{
//this implementation is for PHP where function getallheaders() doesn't exists in CLI
$headers = array();
foreach ($_SERVER as $name => $value) {
if (Strings::startsWith($name, 'HTTP_')) {
$headerName = Strings::removePrefix($name, 'HTTP_');
$key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $headerName))));
$headers[$key] = $value;
}
}
return $headers;
}