2017 © Pedro Peláez
 

library lazy-http-kernel

HttpKernelInterface lazy proxy.

image

stack/lazy-http-kernel

HttpKernelInterface lazy proxy.

  • Tuesday, November 4, 2014
  • by igorw
  • Repository
  • 9 Watchers
  • 30 Stars
  • 26,373 Installations
  • PHP
  • 2 Dependents
  • 1 Suggesters
  • 11 Forks
  • 5 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Stack/LazyHttpKernel

HttpKernelInterface lazy proxy., (*1)

This is useful in combination with something like UrlMap, where sub-kernels are only created conditionally., (*2)

Example

The basic example, assumes that app.php returns an instance of HttpKernelInterface:, (*3)

use Stack\LazyHttpKernel;

$app = new LazyHttpKernel(function () {
    return require __DIR__.'/../app.php';
});

As a shortcut, you can use the Stack\lazy function:, (*4)

use Stack;

$app = Stack\lazy(function () {
    return require __DIR__.'/../app.php';
});

When combined with the UrlMap middleware it makes a bit more sense:, (*5)

use Stack;
use Stack\UrlMap;

$app = ...;

$app = new UrlMap($app, [
    '/foo' => Stack\lazy(function () {
        return require __DIR__.'/../app.php';
    })
]);

The Versions

04/11 2014

dev-master

9999999-dev

HttpKernelInterface lazy proxy.

  Sources   Download

MIT

The Requires

 

The Development Requires

stack

04/12 2013

v1.0.0

1.0.0.0

HttpKernelInterface lazy proxy.

  Sources   Download

MIT

The Requires

 

The Development Requires

stack

14/08 2013

dev-lazy-fn

dev-lazy-fn

HttpKernelInterface lazy proxy.

  Sources   Download

MIT

The Requires

 

The Development Requires

stack