From b6c645e3bfd3c7fd2df7709c6fe9b5f943482647 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 24 May 2013 10:02:45 +0300 Subject: [PATCH 01/83] added link to PHPoAuthLib --- source/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/index.html b/source/index.html index 58b5945..1fb672f 100644 --- a/source/index.html +++ b/source/index.html @@ -51,7 +51,7 @@

URL Map

OAuth

-

Provides experimental OAuth authentication for subsequent middlewares. Leverages PHPoAuthLib.

+

Provides experimental OAuth authentication for subsequent middlewares. Leverages PHPoAuthLib.

Learn More

From 34e45560272ecc1d62b7cb78682c6526c5474e5a Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Tue, 4 Jun 2013 15:05:58 +0200 Subject: [PATCH 02/83] Rework the front page to explain the motivation and list the currently supported frameworks --- source/index.html | 74 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 19 deletions(-) diff --git a/source/index.html b/source/index.html index 1fb672f..884984e 100644 --- a/source/index.html +++ b/source/index.html @@ -20,10 +20,63 @@

Stack


+
+

Why?

+

+ Right now there is no easy way to re-use HTTP-specific code in PHP. Accessing superglobals and emitting headers and data as side effects is messy and unpredictable. While frameworks are becoming more decoupled, they still have their own implementation of anything that touches HTTP. +

+

+ We want to fix this. +

+

+ What worked for the Ruby world with Rack (similar interfaces exist for Java, Python, Perl and others) can work for PHP with Stack. +

+
+ +
+

What is Stack?

- Stack is a convention for composing HttpKernelInterface middlewares. It evolved from a blog post titled HttpKernel middlewares in which it was proposed that HttpKernelInterface decorators could be created to mimic functionality similar to that of Rack or other language-specific HTTP interfaces. + Stack is a convention for composing HttpKernelInterface middlewares. Any framework based on Symfony2's HttpKernelInterface can use these middlewares. They allow an application to be extended in a generic way, simply by wrapping objects around the kernel. +

+
+ +
+ +
+

Which frameworks support Stack?

+

+ The following frameworks and apps are using the HttpKernelInterface abstraction and can thus benefit from Stack: +

+ +

+ As more frameworks and apps join in, more re-use will be possible. +

+
+ +
+ +
+

Conventions

+

+ A stack middleware is just an object that follows these conventions: +

+
    +
  • Implement the HttpKernelInterface
  • +
  • Take the decorated app as the first constructor argument
  • +
  • Decorate the handle call, delegate to the decorated app
  • +
+

+ Yes, leveraging the HTTP abstraction is that easy!

@@ -60,7 +113,7 @@

OAuth


-

Example

+

How do I use it?

use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\HttpCache\Store;
 
@@ -82,23 +135,6 @@ 

Example

$app->terminate($request, $response);
-
- -
-

Your own middleware

-

- A stack middleware is just an object that follows these conventions: -

-
    -
  • Implement the HttpKernelInterface
  • -
  • Take the decorated app as the first constructor argument
  • -
  • Decorate the handle call, delegate to the decorated app
  • -
-

- Yes, leveraging the HTTP abstraction is that easy! -

-
-