Fabien Potencier efa807aa7b [HttpKernel] fixed sub-request which should be always a GET (refs #3657) %!s(int64=13) %!d(string=hai) anos
..
Bundle d664f5f087 Changed the wording of the exception thrown when Bundle::getAlias() returns something different to the Container::underscore version, fixes #1768 %!s(int64=14) %!d(string=hai) anos
CacheWarmer e3421a0b1d [DoctrineBridge] fixed some CS %!s(int64=13) %!d(string=hai) anos
Config 8c0beea677 [Phpdoc] Cleaning/fixing %!s(int64=14) %!d(string=hai) anos
Controller cd24fb86a8 change explode's limit parameter based on known variable content %!s(int64=13) %!d(string=hai) anos
DataCollector 7720cb9be4 [HttpKernel] tagged public @api %!s(int64=14) %!d(string=hai) anos
Debug d96c152c4c [HttpKernel] fixed error message in HttpKernel %!s(int64=14) %!d(string=hai) anos
DependencyInjection 851eb73778 removed unused use statements %!s(int64=13) %!d(string=hai) anos
Event 851eb73778 removed unused use statements %!s(int64=13) %!d(string=hai) anos
EventListener efa807aa7b [HttpKernel] fixed sub-request which should be always a GET (refs #3657) %!s(int64=13) %!d(string=hai) anos
Exception 1238bb3d53 [HttpKernel] lowered the number of level to keep in Flattened exceptions to make the tests pass when XDebug is enabled (beause of the default max nesting level of 100) %!s(int64=14) %!d(string=hai) anos
HttpCache fbed9ff8de Update src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php %!s(int64=13) %!d(string=hai) anos
Log e3421a0b1d [DoctrineBridge] fixed some CS %!s(int64=13) %!d(string=hai) anos
Profiler fe62401907 optimized string starts with checks %!s(int64=13) %!d(string=hai) anos
Util 4316595dbb fixed CS %!s(int64=13) %!d(string=hai) anos
Client.php 5c41ec9e4f [HttpKernel][Client] Only simple (name=value without any other params) cookies can be stored in same line, so lets add every as standalone to be compliant with rfc6265 %!s(int64=13) %!d(string=hai) anos
HttpKernel.php 7720cb9be4 [HttpKernel] tagged public @api %!s(int64=14) %!d(string=hai) anos
HttpKernelInterface.php 7720cb9be4 [HttpKernel] tagged public @api %!s(int64=14) %!d(string=hai) anos
Kernel.php f11f7fcbe0 bumped Symfony version to 2.0.13-DEV %!s(int64=13) %!d(string=hai) anos
KernelEvents.php 7720cb9be4 [HttpKernel] tagged public @api %!s(int64=14) %!d(string=hai) anos
KernelInterface.php bb5fb79c3d changed the way we store the current ob level (refs #2617) %!s(int64=13) %!d(string=hai) anos
LICENSE 89868f7901 Updated LICENSE files copyright %!s(int64=13) %!d(string=hai) anos
README.md 997f354d53 tweaked the README files %!s(int64=13) %!d(string=hai) anos
composer.json 208c2e468c removed the version attribute in all composer.json files %!s(int64=13) %!d(string=hai) anos

README.md

HttpKernel Component

HttpKernel provides the building blocks to create flexible and fast HTTP-based frameworks.

HttpKernelInterface is the core interface of the Symfony2 full-stack framework:

interface HttpKernelInterface
{
    /**
     * Handles a Request to convert it to a Response.
     *
     * @param  Request $request A Request instance
     *
     * @return Response A Response instance
     */
    function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
}

It takes a Request as an input and should return a Response as an output. Using this interface makes your code compatible with all frameworks using the Symfony2 components. And this will gives you many cool features for free.

Creating a framework based on the Symfony2 components is really easy. Here is a very simple, but fully-featured framework based on the Symfony2 components:

$routes = new RouteCollection();
$routes->add('hello', new Route('/hello', array('_controller' =>
    function (Request $request) {
        return new Response(sprintf("Hello %s", $request->get('name')));
    }
)));

$request = Request::createFromGlobals();

$context = new RequestContext();
$context->fromRequest($request);

$matcher = new UrlMatcher($routes, $context);

$dispatcher = new EventDispatcher();
$dispatcher->addSubscriber(new RouterListener($matcher));

$resolver = new ControllerResolver();

$kernel = new HttpKernel($dispatcher, $resolver);

$kernel->handle($request)->send();

This is all you need to create a flexible framework with the Symfony2 components.

Want to add an HTTP reverse proxy and benefit from HTTP caching and Edge Side Includes?

$kernel = new HttpKernel($dispatcher, $resolver);

$kernel = new HttpCache($kernel, new Store(__DIR__.'/cache'));

Want to functional test this small framework?

$client = new Client($kernel);
$crawler = $client->request('GET', '/hello/Fabien');

$this->assertEquals('Fabien', $crawler->filter('p > span')->text());

Want nice error pages instead of ugly PHP exceptions?

$dispatcher->addSubscriber(new ExceptionListener(function (Request $request) {
    $msg = 'Something went wrong! ('.$request->get('exception')->getMessage().')';

    return new Response($msg, 500);
}));

And that's why the simple looking HttpKernelInterface is so powerful. It gives you access to a lot of cool features, ready to be used out of the box, with no efforts.

Resources

Unit tests:

https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/HttpKernel