mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Updated symfony/framework recipe
This commit is contained in:
parent
5e1c5cef3b
commit
e40a6e6079
5 changed files with 28 additions and 46 deletions
|
@ -1,8 +1,8 @@
|
|||
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
||||
framework:
|
||||
secret: '%env(APP_SECRET)%'
|
||||
csrf_protection: true
|
||||
#http_method_override: true
|
||||
#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.
|
||||
|
@ -10,8 +10,15 @@ framework:
|
|||
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
|
||||
|
|
4
config/routes/framework.yaml
Normal file
4
config/routes/framework.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
when@dev:
|
||||
_errors:
|
||||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
||||
prefix: /_error
|
|
@ -1,37 +1,9 @@
|
|||
<?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';
|
||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.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();
|
||||
|
||||
//Set the proxy settings for heroku
|
||||
if ($_SERVER['HEROKU'] ?? $_ENV['HEROKU'] ?? false) {
|
||||
Request::setTrustedProxies([$request->server->get('REMOTE_ADDR')], Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
||||
}
|
||||
|
||||
$response = $kernel->handle($request);
|
||||
$response->send();
|
||||
$kernel->terminate($request, $response);
|
||||
return function (array $context) {
|
||||
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||
};
|
||||
|
|
|
@ -20,10 +20,10 @@ class Kernel extends BaseKernel
|
|||
$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');
|
||||
} elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) {
|
||||
(require $path)($container->withPath($path), $this);
|
||||
} else {
|
||||
$container->import('../config/{services}.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,9 @@ class Kernel extends BaseKernel
|
|||
$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);
|
||||
$routes->import('../config/routes.yaml');
|
||||
} else {
|
||||
$routes->import('../config/{routes}.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
11
symfony.lock
11
symfony.lock
|
@ -548,7 +548,7 @@
|
|||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "4.1",
|
||||
"ref": "f8863cbad2f2e58c4b65fa1eac892ab189971bea"
|
||||
"ref": "0ce7a032d344fb7b661cd25d31914cd703ad445b"
|
||||
},
|
||||
"files": [
|
||||
"./config/packages/dev/debug.yaml"
|
||||
|
@ -603,19 +603,18 @@
|
|||
"version": "v4.2.3"
|
||||
},
|
||||
"symfony/framework-bundle": {
|
||||
"version": "5.2",
|
||||
"version": "5.3",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "5.2",
|
||||
"ref": "6ec87563dcc85cd0c48856dcfbfc29610506d250"
|
||||
"version": "5.3",
|
||||
"ref": "414ba00ad43fa71be42c7906a551f1831716b03c"
|
||||
},
|
||||
"files": [
|
||||
"./config/packages/cache.yaml",
|
||||
"./config/packages/framework.yaml",
|
||||
"./config/packages/test/framework.yaml",
|
||||
"./config/preload.php",
|
||||
"./config/routes/dev/framework.yaml",
|
||||
"./config/routes/framework.yaml",
|
||||
"./config/services.yaml",
|
||||
"./public/index.php",
|
||||
"./src/Controller/.gitignore",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue