Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[READ-ONLY] Subtree split of the Symfony HttpFoundation Component -- clone into Symfony/Component/ (master at symfony/symfony)

Merge branch '2.4'

* 2.4:
  Little correction for case 'ar'
  No need to use mb functions here
  Fix doc-blocks
  Fix doc blocks
  [HttpFoundation] update phpdoc of SessionHandlerInterface and unify parameters of all handlers according to interface
  [Doctrine Bridge] fix DbalSessionHandler for high concurrency, interface compliance, compatibility with all drivers (oci8, mysqli, pdo with mysql, sqlsrv, sqlite)
  [Finder] Marked test skipped when ftp stream wrapper is not available

Conflicts:
	src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php
latest commit 566e2bf9ec
Fabien Potencier fabpot authored April 18, 2014
Octocat-spinner-32 File Merge branch '2.3' into 2.4 April 18, 2014
Octocat-spinner-32 Resources [HttpFoundation] update phpdoc of SessionHandlerInterface and unify p… April 16, 2014
Octocat-spinner-32 Session Merge branch '2.3' into 2.4 April 18, 2014
Octocat-spinner-32 Tests Merge branch '2.4' April 18, 2014
Octocat-spinner-32 .gitignore Added missing files .gitignore July 21, 2013
Octocat-spinner-32 AcceptHeader.php fixed types in phpdocs April 16, 2014
Octocat-spinner-32 AcceptHeaderItem.php fixed types in phpdocs April 16, 2014
Octocat-spinner-32 ApacheRequest.php [HttpFoundation] do not use server variable PATH_INFO because it is a… April 12, 2013
Octocat-spinner-32 BinaryFileResponse.php Merge branch '2.3' into 2.4 April 16, 2014
Octocat-spinner-32 CHANGELOG.md [HttpFoundation] Add ability to change JSON encoding options January 07, 2014
Octocat-spinner-32 Cookie.php fixed types in phpdocs April 16, 2014
Octocat-spinner-32 ExpressionRequestMatcher.php [HttpFoundation] added ExpressionRequestMatcher September 19, 2013
Octocat-spinner-32 FileBag.php [HttpFoundation] fixed typo January 28, 2014
Octocat-spinner-32 HeaderBag.php Merge branch '2.3' into 2.4 April 16, 2014
Octocat-spinner-32 IpUtils.php fixed types in phpdocs April 16, 2014
Octocat-spinner-32 JsonResponse.php fixed types in phpdocs April 16, 2014
Octocat-spinner-32 LICENSE update year on licenses January 07, 2014
Octocat-spinner-32 ParameterBag.php Merge branch '2.3' into 2.4 April 16, 2014
Octocat-spinner-32 README.md updated the composer install command to reflect changes in Composer September 18, 2013
Octocat-spinner-32 RedirectResponse.php made {@inheritdoc} annotations consistent across the board April 16, 2014
Octocat-spinner-32 Request.php Merge branch '2.3' into 2.4 April 18, 2014
Octocat-spinner-32 RequestMatcher.php fixed CS July 01, 2013
Octocat-spinner-32 RequestMatcherInterface.php fixed types in phpdocs April 16, 2014
Octocat-spinner-32 RequestStack.php unified return null usages April 18, 2014
Octocat-spinner-32 Response.php Merge branch '2.4' April 18, 2014
Octocat-spinner-32 ResponseHeaderBag.php [HttpFoundation] Fixed messed up headers February 26, 2013
Octocat-spinner-32 ServerBag.php Merge branch '2.2' into 2.3 (closes #8955) September 07, 2013
Octocat-spinner-32 StreamedResponse.php made types consistent with those defined in Hack April 16, 2014
Octocat-spinner-32 composer.json Merge branch '2.4' March 26, 2014
Octocat-spinner-32 phpunit.xml.dist made usage of Composer autoloader for subtree-split unit tests November 09, 2012
README.md

HttpFoundation Component

HttpFoundation defines an object-oriented layer for the HTTP specification.

It provides an abstraction for requests, responses, uploaded files, cookies, sessions, ...

In this example, we get a Request object from the current PHP global variables:

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

$request = Request::createFromGlobals();
echo $request->getPathInfo();

You can also create a Request directly -- that's interesting for unit testing:

$request = Request::create('/?foo=bar', 'GET');
echo $request->getPathInfo();

And here is how to create and send a Response:

$response = new Response('Not Found', 404, array('Content-Type' => 'text/plain'));
$response->send();

The Request and the Response classes have many other methods that implement the HTTP specification.

Loading

If you are not using Composer but are using PHP 5.3.x, you must add the following to your autoloader:

// SessionHandlerInterface
if (!interface_exists('SessionHandlerInterface')) {
    $loader->registerPrefixFallback(__DIR__.'/../vendor/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs');
}

Resources

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/HttpFoundation/
$ composer.phar install
$ phpunit
Something went wrong with that request. Please try again.