marcj/php-pm — pull request #5 by trq (2014-03-09 04:34:19+00:00)
Title: HttpKernel bridge bootstrapped from the application itself.

I know I have push perms but just wanted to run this past you before it gets merged. Feedback
would be appreciated or just merge it and we go from there.

This PR contains a few changes making the bootstrap process much more flexible and generic.

Firstly, it renames the Bridges\Symfony bridge to Bridges\HttpKernel. This bridge can be used
by any application that implements Symfony's HttpKernelInterface. This includes Symfony, Silex,
Laravel, Drupal, eZ and Yolo.

Within this bridge I have also included StackPHP by default. It adds almost zero overhead and has
some great benifits. This will allow us to decorate apps with a stack of HttpKernelInterface
implementations within PHPPM ourselves if need be, and also will allow users to do the same.

I have moved the actual application bootstrapping into a class within the application itself. This
class needs to implement the new PHPPM\AppBootstrapInterface interface which contains two methods.

* `getApplication` - Should return a configured app implementing the HttpKernelInterface
* `getStack` - Should return a Stack\Builder instance with whatever middles wares you wish to use.

An example implementation that I used in my testing:

```
loadClassCache();

return $app;
}

public function getStack(Builder $stack)
{
$stack->push('Symfony\Component\HttpKernel\HttpCache\HttpCache', new Store(__DIR__ . '/cache'));

return $stack;
}
}
```

The only real caveat at the moment is that the above class needs to be available via autoloading. Easily
achieved by adding a classmap to your projects autoloading within composer.json

```
"classmap": ["./app/AppKernel.php", "./app/AppBootstrap.php"]
```