drupal/core/vendor/Symfony/Component/HttpFoundation
Dries 34ef955ae5 - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
..
File - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
Resources/stubs - Patch #1497182 by Crell, BTMash: Update to latest Symfony 2.1 code. This is commit c4dfe931f1ce8827f8c02975bc0ab405bdc8d27c out of Symfony. 2012-03-28 15:08:43 -04:00
Session - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
Tests - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
ApacheRequest.php - Patch #1343160 by msonnabaum: update Symfony2 components to latest release. 2012-02-23 09:24:11 -05:00
Cookie.php - Patch #1343160 by msonnabaum: update Symfony2 components to latest release. 2012-02-23 09:24:11 -05:00
FileBag.php - Patch #1343160 by msonnabaum: update Symfony2 components to latest release. 2012-02-23 09:24:11 -05:00
HeaderBag.php - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
JsonResponse.php - Patch #1497182 by Crell, BTMash: Update to latest Symfony 2.1 code. This is commit c4dfe931f1ce8827f8c02975bc0ab405bdc8d27c out of Symfony. 2012-03-28 15:08:43 -04:00
LICENSE - Patch #1497182 by Crell, BTMash: Update to latest Symfony 2.1 code. This is commit c4dfe931f1ce8827f8c02975bc0ab405bdc8d27c out of Symfony. 2012-03-28 15:05:43 -04:00
ParameterBag.php - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
README.md - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
RedirectResponse.php - Patch #1497182 by Crell, BTMash: Update to latest Symfony 2.1 code. This is commit c4dfe931f1ce8827f8c02975bc0ab405bdc8d27c out of Symfony. 2012-03-28 15:05:43 -04:00
Request.php - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
RequestMatcher.php - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
RequestMatcherInterface.php Issue #1400748 by Crell, jbrown, plach: Proposal for unified namespace organization. 2012-02-01 12:23:30 +09:00
Response.php - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
ResponseHeaderBag.php - Patch #1497182 by Crell, BTMash: Update to latest Symfony 2.1 code. This is commit c4dfe931f1ce8827f8c02975bc0ab405bdc8d27c out of Symfony. 2012-03-28 15:05:43 -04:00
ServerBag.php - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
StreamedResponse.php - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00
composer.json - Patch #1497182 by Crell, BTMash: Update to latest Symfony 2.1 code. This is commit c4dfe931f1ce8827f8c02975bc0ab405bdc8d27c out of Symfony. 2012-03-28 15:05:43 -04:00
phpunit.xml.dist - Patch #1542710 by BTMash, Crell: update to latest Symfony 2.1 code. 2012-04-28 18:07:40 -04:00

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 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:

phpunit -c src/Symfony/Component/HttpFoundation/