This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/HttpFoundation/ServerBag.php

34 lines
764 B
PHP
Raw Normal View History

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpFoundation;
/**
* HeaderBag is a container for HTTP headers.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>
*/
class ServerBag extends ParameterBag
{
public function getHeaders()
{
$headers = array();
foreach ($this->parameters as $key => $value) {
2011-02-04 04:45:07 +00:00
if ('HTTP_' === substr($key, 0, 5)) {
2011-02-04 11:20:47 +00:00
$headers[substr($key, 5)] = $value;
}
}
return $headers;
}
}