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
|
# 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: false
|
||||||
|
|
||||||
# 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.
|
||||||
# Remove or comment this section to explicitly disable session support.
|
# Remove or comment this section to explicitly disable session support.
|
||||||
|
@ -10,8 +10,15 @@ framework:
|
||||||
handler_id: null
|
handler_id: null
|
||||||
cookie_secure: auto
|
cookie_secure: auto
|
||||||
cookie_samesite: lax
|
cookie_samesite: lax
|
||||||
|
storage_factory_id: session.storage.factory.native
|
||||||
|
|
||||||
#esi: true
|
#esi: true
|
||||||
#fragments: true
|
#fragments: true
|
||||||
php_errors:
|
php_errors:
|
||||||
log: true
|
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
|
<?php
|
||||||
|
|
||||||
use App\Kernel;
|
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');
|
return function (array $context) {
|
||||||
|
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||||
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);
|
|
||||||
|
|
|
@ -20,10 +20,10 @@ class Kernel extends BaseKernel
|
||||||
$container->import('../config/parameters.yaml');
|
$container->import('../config/parameters.yaml');
|
||||||
|
|
||||||
if (is_file(\dirname(__DIR__).'/config/services.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')) {
|
} else {
|
||||||
(require $path)($container->withPath($path), $this);
|
$container->import('../config/{services}.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,9 +33,9 @@ class Kernel extends BaseKernel
|
||||||
$routes->import('../config/{routes}/*.yaml');
|
$routes->import('../config/{routes}/*.yaml');
|
||||||
|
|
||||||
if (is_file(\dirname(__DIR__).'/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')) {
|
} else {
|
||||||
(require $path)($routes->withPath($path), $this);
|
$routes->import('../config/{routes}.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
11
symfony.lock
11
symfony.lock
|
@ -548,7 +548,7 @@
|
||||||
"repo": "github.com/symfony/recipes",
|
"repo": "github.com/symfony/recipes",
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"version": "4.1",
|
"version": "4.1",
|
||||||
"ref": "f8863cbad2f2e58c4b65fa1eac892ab189971bea"
|
"ref": "0ce7a032d344fb7b661cd25d31914cd703ad445b"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"./config/packages/dev/debug.yaml"
|
"./config/packages/dev/debug.yaml"
|
||||||
|
@ -603,19 +603,18 @@
|
||||||
"version": "v4.2.3"
|
"version": "v4.2.3"
|
||||||
},
|
},
|
||||||
"symfony/framework-bundle": {
|
"symfony/framework-bundle": {
|
||||||
"version": "5.2",
|
"version": "5.3",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
"repo": "github.com/symfony/recipes",
|
"repo": "github.com/symfony/recipes",
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"version": "5.2",
|
"version": "5.3",
|
||||||
"ref": "6ec87563dcc85cd0c48856dcfbfc29610506d250"
|
"ref": "414ba00ad43fa71be42c7906a551f1831716b03c"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"./config/packages/cache.yaml",
|
"./config/packages/cache.yaml",
|
||||||
"./config/packages/framework.yaml",
|
"./config/packages/framework.yaml",
|
||||||
"./config/packages/test/framework.yaml",
|
|
||||||
"./config/preload.php",
|
"./config/preload.php",
|
||||||
"./config/routes/dev/framework.yaml",
|
"./config/routes/framework.yaml",
|
||||||
"./config/services.yaml",
|
"./config/services.yaml",
|
||||||
"./public/index.php",
|
"./public/index.php",
|
||||||
"./src/Controller/.gitignore",
|
"./src/Controller/.gitignore",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue