News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

ServerGrove Blog:
Symfony2 components overview HttpKernel
October 01, 2013 @ 11:25:35

On the ServerGrove blog today they've posted the second in their series focusing on individual components of the Symfony2 framework. In this new post they look at the HttpKernel component, another of the foundational blocks of the framework.

In the second post of the Symfony2 components series we are going to talk about the HttpKernel component. If the HttpFoundation component provided the building blocks of the HTTP protocol, the HttpKernel component makes use of them to define an abstract process for converting a Request into a Response.

The post looks at the HttpKernelInterface, the "front door" to the component that takes in a Request object and makes its contents accessible. Also included is a list of some of the configuration options that can be used to alter its behavior, all based on events that fire during execution (the kernel is driven by events). There's also an example included of using the StackPHP middleware as decorators on the kernel.

0 comments voice your opinion now!
symfony2 component overview httpkernel httpkernelinterface stackphp

Link: http://blog.servergrove.com/2013/09/30/symfony2-components-overview-httpkernel/

Gonzalo Ayuso:
Bundles in Silex using Stack
July 17, 2013 @ 11:10:34

Gonzalo Ayuso has a recent post to his site showing you how to use Stack to create bundles for your Silex-based applications. Stack is a structure that allows for the reuse of HttpKernelInterface middleware to create a custom "stack" of functionality.

Nowadays almost every modern framework/applications implements HttpKernelInterface (Symfony, Laravel, Drupal, Silex, Yolo and even the framework that I'm working in ;) ) and we can build complex applications mixing different components and decorate our applications with an elegant syntax. The first thing than come to my mind after studying Stack is to join different Silex applications in a similar way than Symfony (the full stack framework) uses bundles.

In his example, he shows an example of a simple GET endpoint for a blog and API. In the first version, he calls the "run" method to execute the handling of the request. The second example, however, includes the attachment of a simple "MyKernel" middleware to the stack and calls "handle" to apply and send the modified Response back to the user.

0 comments voice your opinion now!
silex stack tutorial introduction middleware httpkernelinterface

Link: http://gonzalo123.com/2013/07/15/bundles-in-silex-using-stack

Igor Wiedler:
Introducing Stack
June 04, 2013 @ 12:46:42

Igor Wiedler has started up a new project that helps you combine "stacks" of middleware related to the HttpKernelInterface from Symfony as a sort of decorator to its base functionality - Stack.

In the post titled HttpKernel middlewares I brought up the idea of bringing rack middlewares to Symfony2. In order to solidify this effort I would like to announce a new project: Stack. Stack is a convention for composing HttpKernelInterface middlewares. The name and logo are based on the idea of building a stack of middleware layers, each of which handles a particular piece of logic. [...] The main goal of stack is to give the idea of "HttpKernel middlewares" a name, so that we can more easily talk about it.

There's a stackphp organization on Github that has the start of this set of middleware pieces including tools to help you build other features. The project is focused around the Symfony HttpKernelInterface because it was the simpler, more standardized option for now. He notes that there's no reason that, in the future, when things are more standardized it couldn't broaden out to PHP as a whole.

0 comments voice your opinion now!
symfony httpkernelinterface stack middleware project

Link: https://igor.io/2013/05/23/introducing-stack.html

Fabien Potencier's Blog:
Create your own framework... on top of the Symfony2 Components (part 10)
January 23, 2012 @ 10:55:22

Fabien Potencier has posted the tenth part of his series about making a custom framework based on the Symfony2 component set. In this latest article he focuses on using the HttpKernelInterface to add in some additional HTTP-related support.

In the conclusion of the second part of this series, I've talked about one great benefit of using the Symfony2 components: the interoperability between all frameworks and applications using them. Let's do a big step towards this goal by making our framework implement HttpKernelInterface.

By changing up the custom framework just a bit to use HttpKernelInterface, you get built-in HTTP caching (HttpCache). He shows how to use this class to create some custom caching rules and how to use Edge Side Includes to only cache partial parts of the page.

0 comments voice your opinion now!
framework symfony2 custom tutorial series httpkernelinterface httpcache



Community Events





Don't see your event here?
Let us know!


api install series package laravel language opinion framework library podcast deployment symfony zendserver list community tips update introduction release interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework