10000 Merge pull request #787 · symfony/recipes@6fb03bf · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fb03bf

Browse files
author
symfony-flex-server[bot]
authored
Merge pull request #787
2 parents 4a02f79 + 9a90e69 commit 6fb03bf

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

symfony/console/5.3/bin/console

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
use App\Kernel;
5+
use Symfony\Bundle\FrameworkBundle\Console\Application;
6+
7+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
8+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
9+
}
10+
11+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
12+
13+
return function (array $context) {
14+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
15+
16+
return new Application($kernel);
17+
};

symfony/console/5.3/manifest.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"copy-from-recipe": {
3+
"bin/": "%BIN_DIR%/"
4+
},
5+
"aliases": ["cli"]
6+
}
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
<?php
22

33
use App\Kernel;
4-
use Symfony\Component\Dotenv\Dotenv;
5-
use Symfony\Component\ErrorHandler\Debug;
6-
use Symfony\Component\HttpFoundation\Request;
74

8-
require dirname(__DIR__).'/vendor/autoload.php';
5+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
96

10-
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
11-
12-
if ($_SERVER['APP_DEBUG']) {
13-
umask(0000);
14-
15-
Debug::enable();
16-
}
17-
18-
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
19-
$request = Request::createFromGlobals();
20-
$response = $kernel->handle($request);
21-
$response->send();
22-
$kernel->terminate($request, $response);
7+
return function (array $context) {
8+
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
9+
};

0 commit comments

Comments
 (0)
0