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

Commit 8f6d2d3

Browse files
committed
init
0 parents  commit 8f6d2d3

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-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.

composer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "stack/run",
3+
"description": "Shortcut function for handling HttpKernel front-controller boilerplate.",
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+
},
20+
"autoload": {
21+
"psr-0": { "Stack": "src" }
22+
},
23+
"extra": {
24+
"branch-alias": { "dev-master": "1.0-dev" }
25+
}
26+
}

src/Stack/run.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Stack;
4+
5+
use Symfony\Component\HttpKernel\HttpKernelInterface;
6+
use Symfony\Component\HttpKernel\TerminableInterface;
7+
use Symfony\Component\HttpFoundation\Request;
8+
9+
function run(HttpKernelInterface $app, Request $request = null)
10+
{
11+
$request = $request ?: Request::createFromGlobals();
12+
13+
$response = $app->handle($request);
14+
$response->send();
15+
if ($app instanceof TerminableInterface) {
16+
$app->terminate($request, $response);
17+
}
18+
}

0 commit comments

Comments
 (0)