Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 2fc0867

Browse files
committed
init
0 parents  commit 2fc0867

File tree

8 files changed

+581
-0
lines changed

8 files changed

+581
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2013 Igor Wiedler
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Stack/LazyHttpKernel
2+
3+
HttpKernelInterface lazy proxy.
4+
5+
This is useful in combination with something like UrlMap, where sub-kernels
6+
are only created conditionally.
7+
8+
## Example
9+
10+
The basic example, assumes that `app.php` returns an instance of
11+
`HttpKernelInterface`:
12+
13+
use Stack\LazyHttpKernel;
14+
use Symfony\Component\HttpFoundation\Request;
15+
use Symfony\Component\HttpFoundation\Response;
16+
17+
$app = new LazyHttpKernel(function () {
18+
return require __DIR__.'/../app.php';
19+
});
20+
21+
When combined with the UrlMap middleware it makes a bit more sense:
22+
23+
use Stack\UrlMap;
24+
use Stack\LazyHttpKernel;
25+
use Symfony\Component\HttpFoundation\Request;
26+
use Symfony\Component\HttpFoundation\Response;
27+
28+
$app = ...;
29+
30+
$app = new UrlMap($app, [
31+
'/foo' => new LazyHttpKernel(function () {
32+
return require __DIR__.'/../app.php';
33+
})
34+
]);

composer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "stack/lazy-http-kernel",
3+
"description": "HttpKernelInterface lazy proxy.",
4+
"keywords": ["stack"],
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Igor Wiedler",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"php": ">=5.4.0",
14+
"symfony/http-foundation": "~2.1",
15+
"symfony/http-kernel": "~2.1"
16+
},
17+
"require-dev": {
18+
"stack/callable-http-kernel": "~1.0@dev",
19+
"stack/url-map": "~1.0@dev"
20+
},
21+
"autoload": {
22+
"psr-0": { "Stack": "src" }
23+
},
24+
"extra": {
25+
"branch-alias": { "dev-master": "1.0-dev" }
26+
}
27+
}

0 commit comments

Comments
 (0)