Files
symfony-flex-recipes/archived/symfony.console/ea8c0eda34fda57e7d5cd8cbd889e2a387e3472c.json
T
github-action[bot]andgithub-action[bot] a5298a919f Update Flex archives
2021-12-18 17:20:12 +00:00

93 lines
4.8 KiB
JSON

{
"manifests": {
"symfony/console": {
"manifest": {
"copy-from-recipe": {
"bin/": "%BIN_DIR%/",
"config/": "%CONFIG_DIR%/"
}
},
"files": {
"bin/console": {
"contents": [
"#!/usr/bin/env php",
"<?php",
"",
"use App\\Kernel;",
"use Symfony\\Bundle\\FrameworkBundle\\Console\\Application;",
"use Symfony\\Component\\Console\\Input\\ArgvInput;",
"use Symfony\\Component\\ErrorHandler\\Debug;",
"",
"if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {",
" echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;",
"}",
"",
"set_time_limit(0);",
"",
"require dirname(__DIR__).'/vendor/autoload.php';",
"",
"if (!class_exists(Application::class)) {",
" throw new LogicException('You need to add \"symfony/framework-bundle\" as a Composer dependency.');",
"}",
"",
"$input = new ArgvInput();",
"if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {",
" putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);",
"}",
"",
"if ($input->hasParameterOption('--no-debug', true)) {",
" putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');",
"}",
"",
"require dirname(__DIR__).'/config/bootstrap.php';",
"",
"if ($_SERVER['APP_DEBUG']) {",
" umask(0000);",
"",
" if (class_exists(Debug::class)) {",
" Debug::enable();",
" }",
"}",
"",
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
"$application = new Application($kernel);",
"$application->run($input);",
""
],
"executable": true
},
"config/bootstrap.php": {
"contents": [
"<?php",
"",
"use Symfony\\Component\\Dotenv\\Dotenv;",
"",
"require dirname(__DIR__).'/vendor/autoload.php';",
"",
"// Load cached env vars if the .env.local.php file exists",
"// Run \"composer dump-env prod\" to create it (requires symfony/flex >=1.2)",
"if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV'] ?? null) === ($env['APP_ENV'] ?? null)) {",
" foreach ($env as $k => $v) {",
" $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v);",
" }",
"} elseif (!class_exists(Dotenv::class)) {",
" throw new RuntimeException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
"} else {",
" // load all the .env files",
" (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');",
"}",
"",
"$_SERVER += $_ENV;",
"$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';",
"$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];",
"$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';",
""
],
"executable": false
}
},
"ref": "ea8c0eda34fda57e7d5cd8cbd889e2a387e3472c"
}
}
}