mirror of
https://github.com/symfony/recipes.git
synced 2026-09-15 09:06:24 +03:00
Update Flex archives
This commit is contained in:
@@ -0,0 +1,233 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%SRC_DIR%/preload.php",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/{services}.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/services.php')) {",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/{routes}.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/routes.php')) {",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "0006b21bd9dde2108655bc2324abbe8a1f42ad07"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%SRC_DIR%/preload.php",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "02cec52f1de59fc4c4315a69dac1f6624427b1f8"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/services.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/services.php')) {",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/routes.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/routes.php')) {",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "02f54ab08d007f94c4655cd68526500cb8f17451"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/*/*.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/services.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/services.php')) {",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/routes.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/routes.php')) {",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "083e82592b343e8df7d508b79858d6965d5d7eee"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "0895c173d85dba5b284a772a411a7c494c8f3a7a"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require symfony/web-server-bundle</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # # The native PHP session handler will be used",
|
||||
" # handler_id: ~",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Migrations,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they",
|
||||
" # have the tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "08e6f6b9886665eaa548595fa953972db651e2b4"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server --dev</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = $_SERVER['APP_DEBUG'] ?? ('prod' !== $env);",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "09357a9c75f41be3bdbf7726453ad8399e8c4ee4"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"Cannot warm up the cache (needs symfony/console).\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\"",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server.\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Migrations,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they",
|
||||
" # have the tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "095436a67829fa7518f8761fb1f4c26e2f7267c1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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')) {",
|
||||
" $_ENV += $env;",
|
||||
"} elseif (!class_exists(Dotenv::class)) {",
|
||||
" throw new RuntimeException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"} else {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv(false);",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "0a20c266736ca946b4ebb088c767f0cb340e41c7"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"cannot warmup the cache (needs symfony/console)\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "0bf335bf61f00e7e41ac56400a97c4a5bc9679da"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command",
|
||||
" 4. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server --dev</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "0c14af72987a342a748ff8a0e3fa9c3d41f2a655"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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')) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "0dfae0b1cd8349ae47659b35602f772b4a7e2280"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"cannot warmup the cache (needs symfony/console)\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "0f239caad9f80d96c1bf5a78d7ec05a28eb7ae0e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
],
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Execute the <comment>make serve</comment> command;",
|
||||
" 2. Browse to the <comment>http://localhost:8000/</comment> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</comment>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" _defaults:",
|
||||
" autowire: true",
|
||||
" public: false",
|
||||
"",
|
||||
" _instanceof:",
|
||||
" Symfony\\Component\\Console\\Command\\Command:",
|
||||
" tags: ['console.command']",
|
||||
" public: true",
|
||||
"",
|
||||
" Twig_ExtensionInterface:",
|
||||
" tags: ['twig.extension']",
|
||||
"",
|
||||
" Symfony\\Component\\EventDispatcher\\EventSubscriberInterface:",
|
||||
" tags: ['kernel.event_subscriber']",
|
||||
"",
|
||||
" Symfony\\Component\\Form\\FormTypeInterface:",
|
||||
" tags: ['form.type']",
|
||||
"",
|
||||
" Symfony\\Component\\Security\\Core\\Authorization\\VoterInterface:",
|
||||
" tags: ['security.voter']",
|
||||
"",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Voter}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"/*",
|
||||
" * This file is part of the Symfony package.",
|
||||
" *",
|
||||
" * (c) Fabien Potencier <fabien@symfony.com>",
|
||||
" *",
|
||||
" * For the full copyright and license information, please view the LICENSE",
|
||||
" * file that was distributed with this source code.",
|
||||
" */",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname($this->getRootDir()).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $confDir = dirname($this->getRootDir()).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname($this->getRootDir()).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "10e1073f4d1a9a9f94f773c6374dc2d763c19e9f"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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')) {",
|
||||
" $_ENV += $env;",
|
||||
"} 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())->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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "11a0e1c059a8e5fd1c7170a544ed2a55b6204d6e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command",
|
||||
" 4. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server --dev</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "1279df12895f20d8076324036431833181eb6645"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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')) {",
|
||||
" $_ENV += $env;",
|
||||
"} elseif (!class_exists(Dotenv::class)) {",
|
||||
" throw new RuntimeException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"} else {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv();",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "131cf901a9447d057bba1c91bc9f0339d49129cc"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # The app cache caches to the filesystem by default. Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = $_SERVER['APP_DEBUG'] ?? ('prod' !== $env);",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "137a14eeb6b3f5370e7147af8aff6518504f50c7"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/services.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/services.php')) {",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/routes.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/routes.php')) {",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "13b8454726e2511d39eb9846fce1980dec5545ae"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command",
|
||||
" 4. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server --dev</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV']) && !isset($_ENV['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';",
|
||||
"$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "1717e67afa995e4f01a25ba9ae7aca5b2327bcaa"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # uncomment this entire section to enable sessions",
|
||||
" #session:",
|
||||
" # # With this config, PHP's native session handling is used",
|
||||
" # handler_id: ~",
|
||||
"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" # Uncomment this section if you're using sessions",
|
||||
" #session:",
|
||||
" # storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = $_SERVER['APP_DEBUG'] ?? ('prod' !== $env);",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "18f6fdceb63737d991efbb37ae9619a6f6c978c8"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "1bbe9a46c76d162f0c81b4f051285d7bac45bdb8"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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']) === $env['APP_ENV']) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "1d7a4a6a2abaaabccc54ac9eac1c3d0210a6f8aa"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require symfony/web-server-bundle</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # # The native PHP session handler will be used",
|
||||
" # handler_id: ~",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" #session:",
|
||||
" # storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{DataFixtures,Entity,Migrations,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they",
|
||||
" # have the tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev'))) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev')));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "1d958e7f37ce5a3599d97121b450f4e489326928"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!array_key_exists('APP_ENV', $_SERVER)) {",
|
||||
" $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] ?? null;",
|
||||
"}",
|
||||
"",
|
||||
"if ('prod' !== $_SERVER['APP_ENV']) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new RuntimeException('The \"APP_ENV\" environment variable is not set to \"prod\". Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
" }",
|
||||
"",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv();",
|
||||
"",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $_SERVER['APP_ENV'] ?: $_ENV['APP_ENV'] ?: '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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "1da1f734a3a2a83860328f443d49bb43545ac237"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"cannot warmup the cache (needs symfony/console)\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start --docroot=public/",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "1eca7bfa16fe2382f3644b312c79ae24032330ef"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (file_exists(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/{services}.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } else {",
|
||||
" $path = \\dirname(__DIR__).'/config/services.php';",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (file_exists(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/{routes}.yaml');",
|
||||
" } else {",
|
||||
" $path = \\dirname(__DIR__).'/config/routes.php';",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "20148abf61a454d2c045931d20e6418c729a675a"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require symfony/web-server-bundle</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # # The native PHP session handler will be used",
|
||||
" # handler_id: ~",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" #session:",
|
||||
" # storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Migrations,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they",
|
||||
" # have the tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2015cd8fef2f9bf5637a0df274072e3e51560f78"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"Kernel::bootstrapEnv();",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" public static function bootstrapCli(array &$argv)",
|
||||
" {",
|
||||
" // consume --env and --no-debug from the command line",
|
||||
"",
|
||||
" // when using symfony/console v4.2 or higher, this should",
|
||||
" // be replaced by a call to Application::bootstrapEnv()",
|
||||
"",
|
||||
" for ($i = 0; $i < \\count($argv) && '--' !== $v = $argv[$i]; ++$i) {",
|
||||
" if ('--no-debug' === $v) {",
|
||||
" putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');",
|
||||
" $argvUnset[$i] = true;",
|
||||
" break;",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" for ($i = 0; $i < \\count($argv) && '--' !== $v = $argv[$i]; ++$i) {",
|
||||
" if (!$v || '-' !== $v[0] || !preg_match('/^-(?:-env(?:=|$)|e=?)(.*)$/D', $v, $v)) {",
|
||||
" continue;",
|
||||
" }",
|
||||
" if (!empty($v[1]) || !empty($argv[1 + $i])) {",
|
||||
" putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = empty($v[1]) ? $argv[1 + $i] : $v[1]);",
|
||||
" $argvUnset[$i] = $argvUnset[$i + empty($v[1])] = true;",
|
||||
" }",
|
||||
" break;",
|
||||
" }",
|
||||
"",
|
||||
" if (!empty($argvUnset)) {",
|
||||
" $argv = array_values(array_diff_key($argv, $argvUnset));",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public static function bootstrapEnv($env = null)",
|
||||
" {",
|
||||
" if (null !== $env) {",
|
||||
" putenv('APP_ENV='.$_SERVER['APP_ENV'] = $env);",
|
||||
" }",
|
||||
"",
|
||||
" if ('prod' !== $_SERVER['APP_ENV'] = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : (isset($_ENV['APP_ENV']) ? $_ENV['APP_ENV'] : null)) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('The \"APP_ENV\" environment variable is not defined. You need to set it or run \"composer require symfony/dotenv\" to load it from a \".env\" file.');",
|
||||
" }",
|
||||
"",
|
||||
" // when using symfony/dotenv v4.2 or higher, this call and the related methods",
|
||||
" // below should be replaced by a call to the new Dotenv::loadEnv() method",
|
||||
" self::loadEnv(new Dotenv(), \\dirname(__DIR__).'/.env');",
|
||||
" }",
|
||||
"",
|
||||
" $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : 'dev';",
|
||||
" $_SERVER['APP_DEBUG'] = isset($_SERVER['APP_DEBUG']) ? $_SERVER['APP_DEBUG'] : (isset($_ENV['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';",
|
||||
" }",
|
||||
"",
|
||||
" private static function loadEnv(Dotenv $dotenv, $path)",
|
||||
" {",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : (isset($_ENV['APP_ENV']) ? $_ENV['APP_ENV'] : null)) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : (isset($_ENV['APP_ENV']) ? $_ENV['APP_ENV'] : $env);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2230e9f42b10616b91a28d15ed3a2d984e0b6c10"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2257d2a1754c7840f49ad04e1d529c402415f4b5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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 += $env;",
|
||||
" $_ENV += $env;",
|
||||
"} 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())->loadEnv(dirname(__DIR__).'/.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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2303f41497833c884862120dca0b0e12d1bfae91"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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']) === $env['APP_ENV']) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "23ecaccc551fe2f74baf613811ae529eb07762fa"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"cannot warmup the cache (needs symfony/console)\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start --docroot=public/",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "23fb6e6c0c6f6461e090bffc332d0d5bb9d907ba"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"CONSOLE=bin/console",
|
||||
"sf_console:",
|
||||
"\t@test -f $(CONSOLE) || printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"\t@exit",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"\t@test -f $(CONSOLE) && $(CONSOLE)|grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start || exit 1",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || PHP_SAPI === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "24b59bd1bd472c549d4cda0d30e3c8e51d07c1f7"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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 += $env;",
|
||||
" $_ENV += $env;",
|
||||
"} 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())->loadEnv(dirname(__DIR__).'/.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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "258876bf931bc0ac7a251bc5bcef6bf20e979163"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo -e \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo -e \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, form types, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # loads services from whatever directories you want (you can add directories!)",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Security}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: 'App\\Controller\\DefaultController::index' }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "25b3f15ef5f84dfee6425272ed09b521f5651ed9"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/{services}.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/services.php')) {",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/{routes}.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/routes.php')) {",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "26c3fa4cb6f2794ce007ea37482b71014bd6f45b"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"CONSOLE=bin/console",
|
||||
"sf_console:",
|
||||
"\t@test -f $(CONSOLE) || printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"\t@exit",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"\t@test -f $(CONSOLE) && $(CONSOLE)|grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start || exit 0",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, form types, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # loads services from whatever directories you want (you can add directories!)",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Security}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: 'App\\Controller\\DefaultController::index' }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || PHP_SAPI === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "26dfde83aaddc5bde46735d3bdde8033fb1fc084"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/src/.bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/.bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!array_key_exists('APP_ENV', $_SERVER)) {",
|
||||
" $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] ?? null;",
|
||||
"}",
|
||||
"",
|
||||
"if ('prod' !== $_SERVER['APP_ENV']) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new RuntimeException('The \"APP_ENV\" environment variable is not set to \"prod\". Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
" }",
|
||||
"",
|
||||
" (new Dotenv())->loadEnv(dirname(__DIR__).'/.env');",
|
||||
"}",
|
||||
"",
|
||||
"$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $_SERVER['APP_ENV'] ?: $_ENV['APP_ENV'] ?: '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
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "27f1dff1215c5b4518b3ce28e4e3d4f117441d19"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
],
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</comment> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</comment> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</comment>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" _defaults:",
|
||||
" autowire: true",
|
||||
" public: false",
|
||||
"",
|
||||
" _instanceof:",
|
||||
" Symfony\\Component\\Console\\Command\\Command:",
|
||||
" tags: ['console.command']",
|
||||
" public: true",
|
||||
"",
|
||||
" Twig_ExtensionInterface:",
|
||||
" tags: ['twig.extension']",
|
||||
"",
|
||||
" Symfony\\Component\\EventDispatcher\\EventSubscriberInterface:",
|
||||
" tags: ['kernel.event_subscriber']",
|
||||
"",
|
||||
" Symfony\\Component\\Form\\FormTypeInterface:",
|
||||
" tags: ['form.type']",
|
||||
"",
|
||||
" Symfony\\Component\\Security\\Core\\Authorization\\VoterInterface:",
|
||||
" tags: ['security.voter']",
|
||||
"",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Voter}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "28acac89a0790b3d10c2869b02dd07d6cd2e1e15"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server --dev</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = $_SERVER['APP_DEBUG'] ?? ('prod' !== $env);",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2a24962874f40ebf35a13e88708b51b6dc0016b1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # The app cache caches to the filesystem by default. Other options include:",
|
||||
"",
|
||||
" # apcu",
|
||||
" # app: cache.adapter.apcu",
|
||||
"",
|
||||
" # redis",
|
||||
" # app: cache.adapter.redis",
|
||||
" # default_redis_provider: redis://localhost",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = $_SERVER['APP_DEBUG'] ?? ('prod' !== $env);",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2a249d5e0ed4175fa67b34500befcdee752216d6"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@bin/console cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@bin/console cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"Cannot warm up the cache (needs symfony/console).\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@bin/console list | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@bin/console server:start",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\"",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server.\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Migrations,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they",
|
||||
" # have the tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2b6c7e9c19afd2b589436d3e5fe0a08d887c163b"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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')) {",
|
||||
" 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 {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv(false);",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2b7c4da8446040065d7105257c70f6675f60500f"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo -e \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo -e \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, form types, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # loads services from whatever directories you want (you can add directories!)",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Security}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2d47568cbe59ad957b318278dea5b4f8907b840b"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
" $container->import('../config/{services}.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
" $routes->import('../config/{routes}.yaml');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2dc519234c2c51951ed759bfeb68fff8cadd7350"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2ef246072b7c1e83e11243ab18d524e3230ff83a"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
"",
|
||||
" # uncomment this entire section to enable sessions",
|
||||
" #session:",
|
||||
" # # With this config, PHP's native session handling is used",
|
||||
" # handler_id: ~",
|
||||
"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" #session:",
|
||||
" # storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev'))) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev')));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "305b268e55e75059f20ec9827a8fd09a35c59866"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"cannot warmup the cache (needs symfony/console)\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "3131f86f58e6942b90097bc624723678372e9eac"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require symfony/web-server-bundle</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # # The native PHP session handler will be used",
|
||||
" # handler_id: ~",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Migrations,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they",
|
||||
" # have the tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "31914091f6fec8b426c30d9090c52faab9c9d74e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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']) === $env['APP_ENV']) {",
|
||||
" 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 {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv(false);",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "31a3ab0d787e7c656eb5c945f232485058f22a15"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/*/*.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" http_method_override: false",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
" storage_factory_id: session.storage.factory.native",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
"when@test:",
|
||||
" framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_factory_id: session.storage.factory.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/framework.yaml": {
|
||||
"contents": [
|
||||
"when@dev:",
|
||||
" _errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"",
|
||||
"require_once dirname(__DIR__).'/vendor/autoload_runtime.php';",
|
||||
"",
|
||||
"return function (array $context) {",
|
||||
" return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);",
|
||||
"};",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/services.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } else {",
|
||||
" $container->import('../config/{services}.php');",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/routes.yaml');",
|
||||
" } else {",
|
||||
" $routes->import('../config/{routes}.php');",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "31c18e2e6030ea34e1530def42d08eb8a534ba8c"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"cannot warmup the cache (needs symfony/console)\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start --docroot=public/",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "345c9163d64dccf38a3b4ce4347cb0ecfa462aa3"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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 += $env;",
|
||||
" $_ENV += $env;",
|
||||
"} elseif (!class_exists(Dotenv::class)) {",
|
||||
" throw new RuntimeException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"} else {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv();",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "345df1d3d62ec3560b72f4922e84654f08abd3a5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "34668142950b6adccbc6e68d316aaacb3357754b"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env if APP_ENV is defined",
|
||||
"if (!isset($_SERVER['APP_ENV']) && !isset($_ENV['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';",
|
||||
"$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "34b48c0aa063b493dbba650c6b65fb29fa5049bf"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
],
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Execute the <comment>make serve</comment> command;",
|
||||
" 2. Browse to the <comment>http://localhost:8000/</comment> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</comment>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" _defaults:",
|
||||
" autowire: true",
|
||||
" public: false",
|
||||
"",
|
||||
" _instanceof:",
|
||||
" Symfony\\Component\\Console\\Command\\Command:",
|
||||
" tags: ['console.command']",
|
||||
" public: true",
|
||||
"",
|
||||
" Twig_ExtensionInterface:",
|
||||
" tags: ['twig.extension']",
|
||||
"",
|
||||
" Symfony\\Component\\EventDispatcher\\EventSubscriberInterface:",
|
||||
" tags: ['kernel.event_subscriber']",
|
||||
"",
|
||||
" Symfony\\Component\\Form\\FormTypeInterface:",
|
||||
" tags: ['form.type']",
|
||||
"",
|
||||
" Symfony\\Component\\Security\\Core\\Authorization\\VoterInterface:",
|
||||
" tags: ['security.voter']",
|
||||
"",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Voter}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.root_dir%/../var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"/*",
|
||||
" * This file is part of the Symfony package.",
|
||||
" *",
|
||||
" * (c) Fabien Potencier <fabien@symfony.com>",
|
||||
" *",
|
||||
" * For the full copyright and license information, please view the LICENSE",
|
||||
" * file that was distributed with this source code.",
|
||||
" */",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname($this->getRootDir()).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $confDir = dirname($this->getRootDir()).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname($this->getRootDir()).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "359f9eb94ffaf653776036065f393c7bd25bf034"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" http_method_override: false",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
" storage_factory_id: session.storage.factory.native",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
"when@test:",
|
||||
" framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_factory_id: session.storage.factory.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/framework.yaml": {
|
||||
"contents": [
|
||||
"when@dev:",
|
||||
" _errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"",
|
||||
"require_once dirname(__DIR__).'/vendor/autoload_runtime.php';",
|
||||
"",
|
||||
"return function (array $context) {",
|
||||
" return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);",
|
||||
"};",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $projectDir = $this->getProjectDir();",
|
||||
"",
|
||||
" $container->import($projectDir.'/config/{packages}/*.yaml');",
|
||||
" $container->import($projectDir.'/config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file($projectDir.'/config/services.yaml')) {",
|
||||
" $container->import($projectDir.'/config/services.yaml');",
|
||||
" $container->import($projectDir.'/config/{services}_'.$this->environment.'.yaml');",
|
||||
" } else {",
|
||||
" $container->import($projectDir.'/config/{services}.php');",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $projectDir = $this->getProjectDir();",
|
||||
"",
|
||||
" $routes->import($projectDir.'/config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import($projectDir.'/config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file($projectDir.'/config/routes.yaml')) {",
|
||||
" $routes->import($projectDir.'/config/routes.yaml');",
|
||||
" } else {",
|
||||
" $routes->import($projectDir.'/config/{routes}.php');",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "3665220abb623938e26f4696573a6eda7100b910"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "36d3075b2b8e0c4de0e82356a86e4c4a4eb6681b"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
" $container->import('../config/{services}.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
" $routes->import('../config/{routes}.yaml');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "37b4ec59eda3eb89705f21a0da7231862495ce0a"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "3b9c85f14cad439042f88f94a1fd15fb8ed923c9"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"CONSOLE=bin/console",
|
||||
"sf_console:",
|
||||
"\t@test -f $(CONSOLE) || printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"\t@exit",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"\t@test -f $(CONSOLE) && $(CONSOLE)|grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start || exit 1",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "3c792543650d60cb293160fcb6cde4e2abd31f9f"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
" $container->import('../config/{services}.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
" $routes->import('../config/{routes}.yaml');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "3dac571bf6f375bd38d66ff79f7e99c0340c2a3f"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"Cannot warm up the cache (needs symfony/console)\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Migrations,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "3f970e2dc1e5c6c38190789b80cf6683b56e3527"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" _defaults:",
|
||||
" autowire: true",
|
||||
" public: false",
|
||||
"",
|
||||
" _instanceof:",
|
||||
" Symfony\\Component\\Console\\Command\\Command:",
|
||||
" tags: ['console.command']",
|
||||
" public: true",
|
||||
"",
|
||||
" Twig_ExtensionInterface:",
|
||||
" tags: ['twig.extension']",
|
||||
"",
|
||||
" Symfony\\Component\\EventDispatcher\\EventSubscriberInterface:",
|
||||
" tags: ['kernel.event_subscriber']",
|
||||
"",
|
||||
" Symfony\\Component\\Form\\FormTypeInterface:",
|
||||
" tags: ['form.type']",
|
||||
"",
|
||||
" Symfony\\Component\\Security\\Core\\Authorization\\VoterInterface:",
|
||||
" tags: ['security.voter']",
|
||||
"",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Voter}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "3fd4a148105eb3384ddeb627b9621cf125c9d3c4"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, form types, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # loads services from whatever directories you want (you can add directories!)",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Security}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "3ff4ceeb63963f851c2a56f6abc048503a82a232"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
],
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Execute the <comment>make serve</comment> command;",
|
||||
" 2. Browse to the <comment>http://localhost:8000/</comment> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</comment>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" _defaults:",
|
||||
" autowire: true",
|
||||
" public: false",
|
||||
"",
|
||||
" _instanceof:",
|
||||
" Symfony\\Component\\Console\\Command\\Command:",
|
||||
" tags: ['console.command']",
|
||||
" public: true",
|
||||
"",
|
||||
" Twig_ExtensionInterface:",
|
||||
" tags: ['twig.extension']",
|
||||
"",
|
||||
" Symfony\\Component\\EventDispatcher\\EventSubscriberInterface:",
|
||||
" tags: ['kernel.event_subscriber']",
|
||||
"",
|
||||
" Symfony\\Component\\Form\\FormTypeInterface:",
|
||||
" tags: ['form.type']",
|
||||
"",
|
||||
" Symfony\\Component\\Security\\Core\\Authorization\\VoterInterface:",
|
||||
" tags: ['security.voter']",
|
||||
"",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Voter}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "412c0575d826fe4b1ce0f0d37fff2f59d807e920"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" http_method_override: false",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
" storage_factory_id: session.storage.factory.native",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
"when@test:",
|
||||
" framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_factory_id: session.storage.factory.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/framework.yaml": {
|
||||
"contents": [
|
||||
"when@dev:",
|
||||
" _errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"",
|
||||
"require_once dirname(__DIR__).'/vendor/autoload_runtime.php';",
|
||||
"",
|
||||
"return function (array $context) {",
|
||||
" return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);",
|
||||
"};",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/services.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } else {",
|
||||
" $container->import('../config/{services}.php');",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/routes.yaml');",
|
||||
" } else {",
|
||||
" $routes->import('../config/{routes}.php');",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "414ba00ad43fa71be42c7906a551f1831716b03c"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
],
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Execute the <comment>make serve</comment> command;",
|
||||
" 2. Browse to the <comment>http://localhost:8000/</comment> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</comment>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" _defaults:",
|
||||
" autowire: true",
|
||||
" public: false",
|
||||
"",
|
||||
" _instanceof:",
|
||||
" Symfony\\Component\\Console\\Command\\Command:",
|
||||
" tags: ['console.command']",
|
||||
" public: true",
|
||||
"",
|
||||
" Twig_ExtensionInterface:",
|
||||
" tags: ['twig.extension']",
|
||||
"",
|
||||
" Symfony\\Component\\EventDispatcher\\EventSubscriberInterface:",
|
||||
" tags: ['kernel.event_subscriber']",
|
||||
"",
|
||||
" Symfony\\Component\\Form\\FormTypeInterface:",
|
||||
" tags: ['form.type']",
|
||||
"",
|
||||
" Symfony\\Component\\Security\\Core\\Authorization\\VoterInterface:",
|
||||
" tags: ['security.voter']",
|
||||
"",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Voter}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "438794cea808fdd2b56f4933ba89d8aab93ac3ab"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server --dev</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = (bool) $_SERVER['APP_DEBUG'] ?? ('prod' !== $env);",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "4764dcec9235a4708181f208bb751d93fe79955f"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require symfony/web-server-bundle</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # # The native PHP session handler will be used",
|
||||
" # handler_id: ~",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" #session:",
|
||||
" # storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Migrations,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they",
|
||||
" # have the tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev'))) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev')));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "4772f8752de95b89b4e1f966c6bd49b48366c068"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"CONSOLE := $(shell which bin/console)",
|
||||
"sf_console:",
|
||||
"ifndef CONSOLE",
|
||||
"\t@printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"endif",
|
||||
"",
|
||||
"cache-clear:",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:clear --no-warmup",
|
||||
"else",
|
||||
"\t@rm -rf var/cache/*",
|
||||
"endif",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"ifdef CONSOLE",
|
||||
"\t@$(CONSOLE) cache:warmup",
|
||||
"else",
|
||||
"\t@printf \"cannot warmup the cache (needs symfony/console)\\n\"",
|
||||
"endif",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"ifndef CONSOLE",
|
||||
"\t@${MAKE} serve_as_php",
|
||||
"endif",
|
||||
"\t@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t public",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "4799ca4a921fc131c74271d35ea5c9a968b79115"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "4a8798f9d8100d6041a1efdee3b569e80b239415"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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 += $env;",
|
||||
" $_ENV += $env;",
|
||||
"} elseif (!class_exists(Dotenv::class)) {",
|
||||
" throw new RuntimeException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"} else {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv();",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $_SERVER['APP_ENV'] ?: $_ENV['APP_ENV'] ?: '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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "4bc8c4d356da086be7e6f7ecc1b06b80dca6fbf0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" _defaults:",
|
||||
" autowire: true",
|
||||
" autoconfigure: true",
|
||||
" public: false",
|
||||
"",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Security}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "4cec1d1daa81892c2b029fc714f9fb514171291d"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,305 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} else {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv(false);",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "4e582450c27d790227d2596a2ffb514fd71d5db7"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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 {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv(false);",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "514256dea19c5c1f88ab23d78fcf2fbaffe9bead"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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')) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /__error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "519a60a1a79246242978342dfd166e880133ba8d"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5226cff6259e8096247cd8ae9d99d8b0fd9b9c2c"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@echo \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\"",
|
||||
"\t@echo \"Quit the server with CTRL-C.\"",
|
||||
"\t@echo \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
".PHONY: serve"
|
||||
],
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Execute the <comment>make serve</comment> command;",
|
||||
" 2. Browse to the <comment>http://localhost:8000/</comment> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</comment>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" _defaults:",
|
||||
" autowire: true",
|
||||
" public: false",
|
||||
"",
|
||||
" _instanceof:",
|
||||
" Symfony\\Component\\Console\\Command\\Command:",
|
||||
" tags: ['console.command']",
|
||||
" public: true",
|
||||
"",
|
||||
" Twig_ExtensionInterface:",
|
||||
" tags: ['twig.extension']",
|
||||
"",
|
||||
" Symfony\\Component\\EventDispatcher\\EventSubscriberInterface:",
|
||||
" tags: ['kernel.event_subscriber']",
|
||||
"",
|
||||
" Symfony\\Component\\Form\\FormTypeInterface:",
|
||||
" tags: ['form.type']",
|
||||
"",
|
||||
" Symfony\\Component\\Security\\Core\\Authorization\\VoterInterface:",
|
||||
" tags: ['security.voter']",
|
||||
"",
|
||||
" App\\:",
|
||||
" resource: '../../src/{Command,Form,EventSubscriber,Twig,Voter}'",
|
||||
"",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: \"%env(APP_SECRET)%\"",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" #trusted_proxies: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: \"%kernel.project_dir%/var/sessions/%kernel.environment%\"",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: \"App\\\\Controller\\\\DefaultController::index\" }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"/*",
|
||||
" * This file is part of the Symfony package.",
|
||||
" *",
|
||||
" * (c) Fabien Potencier <fabien@symfony.com>",
|
||||
" *",
|
||||
" * For the full copyright and license information, please view the LICENSE",
|
||||
" * file that was distributed with this source code.",
|
||||
" */",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->getEnvironment()])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->import($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->getEnvironment())) {",
|
||||
" $loader->import($confDir.'/packages/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->import($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->getEnvironment())) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->getEnvironment().'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "558a13b195ea5ae18afcaf559361221d40db0408"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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']) === $env['APP_ENV']) {",
|
||||
" 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 {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv(false);",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "576c1ff396d1cf36483857422a5aeb24389942a1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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']) === $env['APP_ENV']) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/secrets/prod/.gitignore": {
|
||||
"contents": [
|
||||
"/prod.decrypt.private.php",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || !ini_get('opcache.preload'));",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRouting(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "57fb5b55003dee6c78b40ad4ca123541981eecd6"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <bg=yellow>composer require symfony/web-server-bundle</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: ~",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: ~",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # # The native PHP session handler will be used",
|
||||
" # handler_id: ~",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: ~",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../src/{Entity,Migrations,Repository,Tests}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they",
|
||||
" # have the tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG'] ?? false) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/config';",
|
||||
" if (is_dir($confDir.'/routes/')) {",
|
||||
" $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routes/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "58770238357bb9e914b053675ae5d3250d098c75"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5918a9e19931369d8a8c508c6c8135b541f4c9de"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command",
|
||||
" 4. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server --dev</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env if APP_ENV is defined",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5938deba0582d956c899b1e4f5d5560bd8654f88"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/*/*.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "59be835d74759086bcb6553628d26b5274aa9d4d"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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']) === $env['APP_ENV']) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
" $container->import('../config/{services}.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
" $routes->import('../config/{routes}.yaml');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5b4507e0bfb2efa00525d6427da195b367a7d4d7"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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 += $env;",
|
||||
" $_ENV += $env;",
|
||||
"} 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())->loadEnv(dirname(__DIR__).'/.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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5bb3a8c27df824d195fa68bb635d074854f8498f"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5c0a3ccb7b710c6a2328bfaacd416bd4c40f2030"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Run <comment>composer require server --dev</> to install the development web server,",
|
||||
" or configure another supported web server <comment>https://symfony.com/doc/current/setup/web_server_configuration.html</>",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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')) {",
|
||||
" foreach ($env as $name => $value) {",
|
||||
" putenv(\"$name=$value\");",
|
||||
" }",
|
||||
" $_SERVER += $env;",
|
||||
" $_ENV += $env;",
|
||||
"} 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())->loadEnv(dirname(__DIR__).'/.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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: ~",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5c6cb121b312d59974d4fd528e434c845374079b"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" http_method_override: false",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/services.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/services.php')) {",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/routes.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/routes.php')) {",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5c6e63791bb2f2bc6fe5d41bda7c90700c4494e6"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/preload.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {",
|
||||
" require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/'",
|
||||
" exclude:",
|
||||
" - '../src/DependencyInjection/'",
|
||||
" - '../src/Entity/'",
|
||||
" - '../src/Kernel.php'",
|
||||
" - '../src/Tests/'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller/'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/services.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/services.php')) {",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (is_file(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/routes.yaml');",
|
||||
" } elseif (is_file($path = \\dirname(__DIR__).'/config/routes.php')) {",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "5f0d0fd82ffa3580fe0ce8e3b2d18506ebf37a0e"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/public/bundles/",
|
||||
"/var/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" Quit the server with CTRL-C.",
|
||||
" Run <comment>composer require server --dev</> for a better web server.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: ~",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
"",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!isset($_SERVER['APP_ENV'])) {",
|
||||
" if (!class_exists(Dotenv::class)) {",
|
||||
" throw new \\RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add \"symfony/dotenv\" as a Composer dependency to load variables from a .env file.');",
|
||||
" }",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"$env = $_SERVER['APP_ENV'] ?? 'dev';",
|
||||
"$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));",
|
||||
"",
|
||||
"if ($debug) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts(explode(',', $trustedHosts));",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($env, $debug);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "60ac64d0ec3f8e92bda67567eff5a313a359c94b"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^localhost|example\\.com$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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')) {",
|
||||
" 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Put the unique name of your app here: the prefix seed",
|
||||
" # is used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The app cache caches to the filesystem by default.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "61ad963f28c091b8bb9449507654b9c7d8bbb53c"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"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 {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv(false);",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "642a53a4fc9a5d3618e6839521254096c37db6eb"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"# see https://symfony.com/doc/current/reference/configuration/framework.html",
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "6451cb115d548cf20f05a3ad664dec99d3baac62"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"",
|
||||
"return static function (RoutingConfigurator $routes, Kernel $kernel): void {",
|
||||
"",
|
||||
"// $routes->add('index', '/')",
|
||||
"// ->controller([App\\Controller\\DefaultController::class, 'index'])",
|
||||
"// ;",
|
||||
"",
|
||||
"};",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/routes/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"_errors:",
|
||||
" resource: '@FrameworkBundle/Resources/config/routing/errors.xml'",
|
||||
" prefix: /_error",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator as di;",
|
||||
"",
|
||||
"// This file is the entry point to configure your own services.",
|
||||
"// Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"return static function (di\\ContainerConfigurator $container, Kernel $kernel): void {",
|
||||
"",
|
||||
" // Parameters are configuration that don't need to change depending on the machine where the app is deployed.",
|
||||
" // see https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
" $container->parameters()",
|
||||
" // ->set(...)",
|
||||
" ;",
|
||||
"",
|
||||
" $services = $container->services()",
|
||||
" ->defaults()",
|
||||
" ->autowire()",
|
||||
" ->autoconfigure()",
|
||||
" ;",
|
||||
"",
|
||||
" // Makes classes in src/ available to be used as services",
|
||||
" $src = dirname(__DIR__).'/src';",
|
||||
" $services",
|
||||
" ->load('App\\\\', $src)",
|
||||
" ->exclude([",
|
||||
" $src.'/DependencyInjection',",
|
||||
" $src.'/Entity',",
|
||||
" $src.'/Migrations',",
|
||||
" $src.'/Tests',",
|
||||
" $src.'/Kernel.php',",
|
||||
" ])",
|
||||
" ;",
|
||||
"",
|
||||
" // Controllers are imported separately to make sure services can be injected",
|
||||
" // as action arguments even if you don't extend any base controller class",
|
||||
" $services",
|
||||
" ->load('App\\\\Controller\\\\', $src.'/Controller')",
|
||||
" ->tag('controller.service_arguments')",
|
||||
" ;",
|
||||
"",
|
||||
" // Add more service definitions when explicit configuration is needed.",
|
||||
" // Please note that last definitions *replace* previous ones when using $services->set().",
|
||||
" // It is possible to alter a previously declared definition by using $services->get() instead.",
|
||||
" $services",
|
||||
" // ->set(App\\MyService::class)",
|
||||
" // ->args([di\\ref(App\\AnotherService::class)])",
|
||||
" ;",
|
||||
"",
|
||||
" if ('test' === $kernel->getEnvironment()) {",
|
||||
" // When a test case needs access to a service, getting it via",
|
||||
" // a public alias with the \"test.\" prefix is recommended.",
|
||||
" $services->public()",
|
||||
" // ->alias('test.App\\MyService', App\\MyService::class)",
|
||||
" ;",
|
||||
" }",
|
||||
"",
|
||||
"};",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\ErrorHandler\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Routing\\Loader\\Configurator\\RoutingConfigurator;",
|
||||
"use Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" protected function configureContainer(ContainerConfigurator $container): void",
|
||||
" {",
|
||||
" $container->import('../config/{packages}/*.yaml');",
|
||||
" $container->import('../config/{packages}/'.$this->environment.'/*.yaml');",
|
||||
"",
|
||||
" if (file_exists(\\dirname(__DIR__).'/config/services.yaml')) {",
|
||||
" $container->import('../config/{services}.yaml');",
|
||||
" $container->import('../config/{services}_'.$this->environment.'.yaml');",
|
||||
" } else {",
|
||||
" $path = \\dirname(__DIR__).'/config/services.php';",
|
||||
" (require $path)($container->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RoutingConfigurator $routes): void",
|
||||
" {",
|
||||
" $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');",
|
||||
" $routes->import('../config/{routes}/*.yaml');",
|
||||
"",
|
||||
" if (file_exists(\\dirname(__DIR__).'/config/routes.yaml')) {",
|
||||
" $routes->import('../config/{routes}.yaml');",
|
||||
" } else {",
|
||||
" $path = \\dirname(__DIR__).'/config/routes.php';",
|
||||
" (require $path)($routes->withPath($path), $this);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "647552710bcf78736b92bf7a145eed9b972d0566"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%CONFIG_DIR%/secrets/prod/prod.decrypt.private.php",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} 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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
" cookie_secure: auto",
|
||||
" cookie_samesite: lax",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" public function getProjectDir(): string",
|
||||
" {",
|
||||
" return \\dirname(__DIR__);",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', \\PHP_VERSION_ID < 70400 || $this->debug);",
|
||||
" $container->setParameter('container.dumper.inline_factories', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "65aac89dfbfb62b753b04ecb41c8a054a80865b1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,294 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/",
|
||||
"web/": "%WEB_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"make cache-warmup": "script",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_DEBUG": "1",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
"/var/",
|
||||
"/vendor/",
|
||||
"/web/bundles/"
|
||||
],
|
||||
"post-install-output": [
|
||||
"<bg=blue;fg=white> </>",
|
||||
"<bg=blue;fg=white> What's next? </>",
|
||||
"<bg=blue;fg=white> </>",
|
||||
"",
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Change to the project directory",
|
||||
" 2. Execute the <comment>make serve</> command;",
|
||||
" 3. Browse to the <comment>http://localhost:8000/</> URL.",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
],
|
||||
"makefile": [
|
||||
"cache-clear:",
|
||||
"\t@test -f bin/console && bin/console cache:clear --no-warmup || rm -rf var/cache/*",
|
||||
".PHONY: cache-clear",
|
||||
"",
|
||||
"cache-warmup: cache-clear",
|
||||
"\t@test -f bin/console && bin/console cache:warmup || echo \"cannot warmup the cache (needs symfony/console)\"",
|
||||
".PHONY: cache-warmup",
|
||||
"",
|
||||
"CONSOLE=bin/console",
|
||||
"sf_console:",
|
||||
"\t@test -f $(CONSOLE) || printf \"Run \\033[32mcomposer require cli\\033[39m to install the Symfony console.\\n\"",
|
||||
"\t@exit",
|
||||
"",
|
||||
"serve_as_sf: sf_console",
|
||||
"\t@test -f $(CONSOLE) && $(CONSOLE)|grep server:start > /dev/null || ${MAKE} serve_as_php",
|
||||
"\t@$(CONSOLE) server:start || exit 1",
|
||||
"",
|
||||
"\t@printf \"Quit the server with \\033[32;49mbin/console server:stop.\\033[39m\\n\"",
|
||||
"",
|
||||
"serve_as_php:",
|
||||
"\t@printf \"\\033[32;49mServer listening on http://127.0.0.1:8000\\033[39m\\n\";",
|
||||
"\t@printf \"Quit the server with CTRL-C.\\n\"",
|
||||
"\t@printf \"Run \\033[32mcomposer require symfony/web-server-bundle\\033[39m for a better web server\\n\"",
|
||||
"\tphp -S 127.0.0.1:8000 -t web",
|
||||
"",
|
||||
"serve:",
|
||||
"\t@${MAKE} serve_as_sf",
|
||||
".PHONY: sf_console serve serve_as_sf serve_as_php"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"etc/container.yaml": {
|
||||
"contents": [
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/app.yaml": {
|
||||
"contents": [
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" # automatically injects dependencies in your services",
|
||||
" autowire: true",
|
||||
" # automatically registers your services as commands, event subscribers, etc.",
|
||||
" autoconfigure: true",
|
||||
" # this means you cannot fetch services directly from the container via $container->get()",
|
||||
" # if you need to do this, you can override this setting on individual services",
|
||||
" public: false",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../../src/*'",
|
||||
" # you can exclude directories or files",
|
||||
" # but if a service is unused, it's removed anyway",
|
||||
" exclude: '../../src/{Entity,Repository}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure they're public",
|
||||
" # and have a tag that allows actions to type-hint services",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../../src/Controller'",
|
||||
" public: true",
|
||||
" tags: ['controller.service_arguments']",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/dev/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" router:",
|
||||
" strict_requirements: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #default_locale: en",
|
||||
" #csrf_protection: null",
|
||||
" #http_method_override: true",
|
||||
" #trusted_hosts: null",
|
||||
" # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id",
|
||||
" #session:",
|
||||
" # handler_id: session.handler.native_file",
|
||||
" # save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'",
|
||||
" #esi: ~",
|
||||
" #fragments: ~",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
" router:",
|
||||
" strict_requirements: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: null",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"etc/routing.yaml": {
|
||||
"contents": [
|
||||
"#index:",
|
||||
"# path: /",
|
||||
"# defaults: { _controller: 'App\\Controller\\DefaultController::index' }",
|
||||
"",
|
||||
"# Depends on sensio/framework-extra-bundle:^3.0 and doctrine/annotations",
|
||||
"#controllers:",
|
||||
"# resource: ../src/Controller/",
|
||||
"# type: annotation",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitkeep": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"/**",
|
||||
" * @author Fabien Potencier <fabien@symfony.com>",
|
||||
" */",
|
||||
"final class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" private const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir(): string",
|
||||
" {",
|
||||
" return dirname(__DIR__).'/var/logs';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles(): iterable",
|
||||
" {",
|
||||
" $contents = require dirname(__DIR__).'/etc/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if (isset($envs['all']) || isset($envs[$this->environment])) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" if (is_dir($confDir.'/packages/'.$this->environment)) {",
|
||||
" $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
" $loader->load($confDir.'/container'.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes): void",
|
||||
" {",
|
||||
" $confDir = dirname(__DIR__).'/etc';",
|
||||
" if (is_dir($confDir.'/routing/')) {",
|
||||
" $routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" if (is_dir($confDir.'/routing/'.$this->environment)) {",
|
||||
" $routes->import($confDir.'/routing/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
" $routes->import($confDir.'/routing'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"web/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"",
|
||||
"require __DIR__.'/../vendor/autoload.php';",
|
||||
"",
|
||||
"// The check is to ensure we don't use .env in production",
|
||||
"if (!getenv('APP_ENV')) {",
|
||||
" (new Dotenv())->load(__DIR__.'/../.env');",
|
||||
"}",
|
||||
"",
|
||||
"if (getenv('APP_DEBUG')) {",
|
||||
" // WARNING: You should setup permissions the proper way!",
|
||||
" // REMOVE the following PHP line and read",
|
||||
" // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" // This check prevents access to debug front controllers that are deployed by accident to production servers.",
|
||||
" // Feel free to remove this, extend it, or make something more sophisticated.",
|
||||
" if (isset($_SERVER['HTTP_CLIENT_IP'])",
|
||||
" || isset($_SERVER['HTTP_X_FORWARDED_FOR'])",
|
||||
" || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || PHP_SAPI === 'cli-server')",
|
||||
" ) {",
|
||||
" header('HTTP/1.0 403 Forbidden');",
|
||||
" exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');",
|
||||
" }",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);",
|
||||
"",
|
||||
"$kernel = new Kernel(getenv('APP_ENV'), getenv('APP_DEBUG'));",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "682ca0ce33c95016c21d3fdb388d9c3c41773cc0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/framework-bundle": {
|
||||
"manifest": {
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": [
|
||||
"all"
|
||||
]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"public/": "%PUBLIC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "'^(localhost|example\\.com)$'"
|
||||
},
|
||||
"gitignore": [
|
||||
"/.env.local",
|
||||
"/.env.local.php",
|
||||
"/.env.*.local",
|
||||
"/%PUBLIC_DIR%/bundles/",
|
||||
"/%VAR_DIR%/",
|
||||
"/vendor/"
|
||||
],
|
||||
"post-install-output": [
|
||||
" * <fg=blue>Run</> your application:",
|
||||
" 1. Go to the project directory",
|
||||
" 2. Create your code repository with the <comment>git init</comment> command",
|
||||
" 3. Download the Symfony CLI at <comment>https://symfony.com/download</> to install a development web server,",
|
||||
" or run <comment>composer require server --dev</> for a minimalist one",
|
||||
"",
|
||||
" * <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>"
|
||||
]
|
||||
},
|
||||
"files": {
|
||||
"config/bootstrap.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use Symfony\\Component\\Dotenv\\Dotenv;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/vendor/autoload.php';",
|
||||
"",
|
||||
"if (!class_exists(Dotenv::class)) {",
|
||||
" throw new LogicException('Please run \"composer require symfony/dotenv\" to load the \".env\" files configuring the application.');",
|
||||
"}",
|
||||
"",
|
||||
"// 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') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {",
|
||||
" (new Dotenv(false))->populate($env);",
|
||||
"} else {",
|
||||
" $path = dirname(__DIR__).'/.env';",
|
||||
" $dotenv = new Dotenv(false);",
|
||||
"",
|
||||
" // load all the .env files",
|
||||
" if (method_exists($dotenv, 'loadEnv')) {",
|
||||
" $dotenv->loadEnv($path);",
|
||||
" } else {",
|
||||
" // fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)",
|
||||
"",
|
||||
" if (file_exists($path) || !file_exists($p = \"$path.dist\")) {",
|
||||
" $dotenv->load($path);",
|
||||
" } else {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {",
|
||||
" $dotenv->populate(array('APP_ENV' => $env = 'dev'));",
|
||||
" }",
|
||||
"",
|
||||
" if ('test' !== $env && file_exists($p = \"$path.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
"",
|
||||
" if (file_exists($p = \"$path.$env.local\")) {",
|
||||
" $dotenv->load($p);",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"$_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
|
||||
},
|
||||
"config/packages/cache.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" cache:",
|
||||
" # Unique name of your app: used to compute stable namespaces for cache keys.",
|
||||
" #prefix_seed: your_vendor_name/app_name",
|
||||
"",
|
||||
" # The \"app\" cache stores to the filesystem by default.",
|
||||
" # The data in this cache should persist between deploys.",
|
||||
" # Other options include:",
|
||||
"",
|
||||
" # Redis",
|
||||
" #app: cache.adapter.redis",
|
||||
" #default_redis_provider: redis://localhost",
|
||||
"",
|
||||
" # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)",
|
||||
" #app: cache.adapter.apcu",
|
||||
"",
|
||||
" # Namespaced pools use the above \"app\" backend by default",
|
||||
" #pools:",
|
||||
" #my.dedicated.cache: null",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" secret: '%env(APP_SECRET)%'",
|
||||
" #csrf_protection: true",
|
||||
" #http_method_override: true",
|
||||
"",
|
||||
" # Enables session support. Note that the session will ONLY be started if you read or write from it.",
|
||||
" # Remove or comment this section to explicitly disable session support.",
|
||||
" session:",
|
||||
" handler_id: null",
|
||||
"",
|
||||
" #esi: true",
|
||||
" #fragments: true",
|
||||
" php_errors:",
|
||||
" log: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/packages/test/framework.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" test: true",
|
||||
" session:",
|
||||
" storage_id: session.storage.mock_file",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"config/services.yaml": {
|
||||
"contents": [
|
||||
"# This file is the entry point to configure your own services.",
|
||||
"# Files in the packages/ subdirectory configure your dependencies.",
|
||||
"",
|
||||
"# Put parameters here that don't need to change on each machine where the app is deployed",
|
||||
"# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration",
|
||||
"parameters:",
|
||||
"",
|
||||
"services:",
|
||||
" # default configuration for services in *this* file",
|
||||
" _defaults:",
|
||||
" autowire: true # Automatically injects dependencies in your services.",
|
||||
" autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.",
|
||||
" public: false # Allows optimizing the container by removing unused services; this also means",
|
||||
" # fetching services directly from the container via $container->get() won't work.",
|
||||
" # The best practice is to be explicit about your dependencies anyway.",
|
||||
"",
|
||||
" # makes classes in src/ available to be used as services",
|
||||
" # this creates a service per class whose id is the fully-qualified class name",
|
||||
" App\\:",
|
||||
" resource: '../src/*'",
|
||||
" exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'",
|
||||
"",
|
||||
" # controllers are imported separately to make sure services can be injected",
|
||||
" # as action arguments even if you don't extend any base controller class",
|
||||
" App\\Controller\\:",
|
||||
" resource: '../src/Controller'",
|
||||
" tags: ['controller.service_arguments']",
|
||||
"",
|
||||
" # add more service definitions when explicit configuration is needed",
|
||||
" # please note that last definitions always *replace* previous ones",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"public/index.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"use App\\Kernel;",
|
||||
"use Symfony\\Component\\Debug\\Debug;",
|
||||
"use Symfony\\Component\\HttpFoundation\\Request;",
|
||||
"",
|
||||
"require dirname(__DIR__).'/config/bootstrap.php';",
|
||||
"",
|
||||
"if ($_SERVER['APP_DEBUG']) {",
|
||||
" umask(0000);",
|
||||
"",
|
||||
" Debug::enable();",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {",
|
||||
" Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);",
|
||||
"}",
|
||||
"",
|
||||
"if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {",
|
||||
" Request::setTrustedHosts([$trustedHosts]);",
|
||||
"}",
|
||||
"",
|
||||
"$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);",
|
||||
"$request = Request::createFromGlobals();",
|
||||
"$response = $kernel->handle($request);",
|
||||
"$response->send();",
|
||||
"$kernel->terminate($request, $response);",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Controller/.gitignore": {
|
||||
"contents": [
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Kernel.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait;",
|
||||
"use Symfony\\Component\\Config\\Loader\\LoaderInterface;",
|
||||
"use Symfony\\Component\\Config\\Resource\\FileResource;",
|
||||
"use Symfony\\Component\\DependencyInjection\\ContainerBuilder;",
|
||||
"use Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;",
|
||||
"use Symfony\\Component\\Routing\\RouteCollectionBuilder;",
|
||||
"",
|
||||
"class Kernel extends BaseKernel",
|
||||
"{",
|
||||
" use MicroKernelTrait;",
|
||||
"",
|
||||
" const CONFIG_EXTS = '.{php,xml,yaml,yml}';",
|
||||
"",
|
||||
" public function getCacheDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/cache/'.$this->environment;",
|
||||
" }",
|
||||
"",
|
||||
" public function getLogDir()",
|
||||
" {",
|
||||
" return $this->getProjectDir().'/var/log';",
|
||||
" }",
|
||||
"",
|
||||
" public function registerBundles()",
|
||||
" {",
|
||||
" $contents = require $this->getProjectDir().'/config/bundles.php';",
|
||||
" foreach ($contents as $class => $envs) {",
|
||||
" if ($envs[$this->environment] ?? $envs['all'] ?? false) {",
|
||||
" yield new $class();",
|
||||
" }",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)",
|
||||
" {",
|
||||
" $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));",
|
||||
" // Feel free to remove the \"container.autowiring.strict_mode\" parameter",
|
||||
" // if you are using symfony/dependency-injection 4.0+ as it's the default behavior",
|
||||
" $container->setParameter('container.autowiring.strict_mode', true);",
|
||||
" $container->setParameter('container.dumper.inline_class_loader', true);",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');",
|
||||
" $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');",
|
||||
" }",
|
||||
"",
|
||||
" protected function configureRoutes(RouteCollectionBuilder $routes)",
|
||||
" {",
|
||||
" $confDir = $this->getProjectDir().'/config';",
|
||||
"",
|
||||
" $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "6b7854b4c2866b32bc86e98977e2ead4669fa9a5"
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user