Updated recipe of framework bundle.

This commit is contained in:
Jan Böhmer 2020-07-04 23:44:15 +02:00
parent 96acf0d858
commit 7c876b4a9c
3 changed files with 18 additions and 7 deletions

View file

@ -1,6 +1,7 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework: framework:
secret: '%env(APP_SECRET)%' secret: '%env(APP_SECRET)%'
#csrf_protection: true csrf_protection: true
#http_method_override: true #http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it. # Enables session support. Note that the session will ONLY be started if you read or write from it.

View file

@ -15,17 +15,27 @@ class Kernel extends BaseKernel
{ {
$container->import('../config/{packages}/*.yaml'); $container->import('../config/{packages}/*.yaml');
$container->import('../config/{packages}/'.$this->environment.'/*.yaml'); $container->import('../config/{packages}/'.$this->environment.'/*.yaml');
//Add parameters.yml
$container->import('../config/parameters.yaml');
if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
$container->import('../config/{services}.yaml'); $container->import('../config/{services}.yaml');
$container->import('../config/{services}_'.$this->environment.'.yaml'); $container->import('../config/{services}_'.$this->environment.'.yaml');
} elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) {
//Add parameter file (require $path)($container->withPath($path), $this);
$container->import('../config/parameters.yaml'); }
} }
protected function configureRoutes(RoutingConfigurator $routes): void protected function configureRoutes(RoutingConfigurator $routes): void
{ {
$routes->import('../config/{routes}/'.$this->environment.'/*.yaml'); $routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
$routes->import('../config/{routes}/*.yaml'); $routes->import('../config/{routes}/*.yaml');
if (is_file(\dirname(__DIR__).'/config/routes.yaml')) {
$routes->import('../config/{routes}.yaml'); $routes->import('../config/{routes}.yaml');
} elseif (is_file($path = \dirname(__DIR__).'/config/routes.php')) {
(require $path)($routes->withPath($path), $this);
}
} }
} }

View file

@ -204,7 +204,7 @@
"repo": "github.com/symfony/recipes-contrib", "repo": "github.com/symfony/recipes-contrib",
"branch": "master", "branch": "master",
"version": "1.8", "version": "1.8",
"ref": "1d42bc3f713130582e6e0c475c49bc327ab0a2a2" "ref": "5a5bdc2d0e2533ed6935d5ae562f2b318a8fc1ee"
}, },
"files": [ "files": [
"./config/packages/liip_imagine.yaml", "./config/packages/liip_imagine.yaml",
@ -581,7 +581,7 @@
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "master", "branch": "master",
"version": "5.1", "version": "5.1",
"ref": "37b4ec59eda3eb89705f21a0da7231862495ce0a" "ref": "ffcb76bab779154c0a7d8cddb9f448c2c45a4e50"
}, },
"files": [ "files": [
"./config/packages/cache.yaml", "./config/packages/cache.yaml",