Skip to content

Commit d8559eb

Browse files
authored
Merge pull request #50 from sumocoders/framework-14
Update config to framework 14
2 parents 9b2b496 + b3ef931 commit d8559eb

File tree

11 files changed

+47
-71
lines changed

11 files changed

+47
-71
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ MAILER_DEFAULT_TO_EMAIL="mailer_default_to_email_is_misconfigured@tesuta.be"
4444
# Choose one of the transports below
4545
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
4646
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
47-
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
47+
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=1
4848
###< symfony/messenger ###
4949

5050
###> sumocoders/framework-core-bundle ###
5151
SITE_TITLE="Your application"
5252
ENCRYPTION_KEY="8ea13de9680e2a1441774ec26642fa65a56d8099f44a301f219864b51bbaa925"
5353
DEFAULT_URI="/"
54-
###< sumocoders/framework-core-bundle ###
54+
###< sumocoders/framework-core-bundle ###

.gitlab-ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Install dependencies and build assets:
2424
- COMPOSER_MEMORY_LIMIT=-1 composer run-script post-autoload-dump
2525
- php bin/console importmap:install --no-interaction
2626
- php bin/console sass:build --no-interaction
27-
- php bin/console fos:js-routing:dump --format=json --locale=nl --target=public/build/routes/fos_js_routes.json
2827
cache:
2928
<<: *global_cache
3029
policy: pull-push
@@ -170,7 +169,7 @@ PHP packages - composer outdated:
170169
PHPUnit - Run tests:
171170
image: sumocoders/framework-php84:latest
172171
services:
173-
- mysql:5.7
172+
- mysql:8.0
174173
before_script:
175174
# Uncomment this if you need Chrome for PDF's
176175
# or if you have integration tests that use Symfony Panther (https://github.com/symfony/panther)

bin/console

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,19 @@
33

44
use App\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
6-
use Symfony\Component\Console\Input\ArgvInput;
7-
use Symfony\Component\Dotenv\Dotenv;
8-
use Symfony\Component\ErrorHandler\Debug;
96

10-
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
11-
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
7+
if (!is_dir(dirname(__DIR__).'/vendor')) {
8+
throw new LogicException('Dependencies are missing. Try running "composer install".');
129
}
1310

14-
set_time_limit(0);
15-
16-
require dirname(__DIR__).'/vendor/autoload.php';
17-
18-
if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {
19-
throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.');
20-
}
21-
22-
$input = new ArgvInput();
23-
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
24-
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
11+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
12+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
2513
}
2614

27-
if ($input->hasParameterOption('--no-debug', true)) {
28-
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
29-
}
30-
31-
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
15+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
3216

33-
if ($_SERVER['APP_DEBUG']) {
34-
umask(0000);
35-
36-
if (class_exists(Debug::class)) {
37-
Debug::enable();
38-
}
39-
}
17+
return function (array $context) {
18+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
4019

41-
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
42-
$application = new Application($kernel);
43-
$application->run($input);
20+
return new Application($kernel);
21+
};

config/bundles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
return [
44
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
55
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
6+
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
67
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
78
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
89
Sentry\SentryBundle\SentryBundle::class => ['prod' => true],
@@ -11,6 +12,7 @@
1112
Symfony\UX\TogglePassword\TogglePasswordBundle::class => ['all' => true],
1213
Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true],
1314
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
15+
Nelmio\SecurityBundle\NelmioSecurityBundle::class => ['all' => true],
1416
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
1517
SumoCoders\FrameworkCoreBundle\SumoCodersFrameworkCoreBundle::class => ['all' => true],
1618
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
@@ -20,6 +22,4 @@
2022
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
2123
Symfony\UX\Turbo\TurboBundle::class => ['all' => true],
2224
Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true],
23-
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
24-
Nelmio\SecurityBundle\NelmioSecurityBundle::class => ['all' => true],
2525
];

config/packages/mailer.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
framework:
22
mailer:
33
dsn: '%env(MAILER_DSN)%'
4+
5+
when@dev:
6+
framework:
7+
mailer:
8+
envelope:
9+
# needs at least one recipient, otherwise allowed_recipients is ignored
10+
recipients: ['mail@localhost']
11+
allowed_recipients:
12+
- '.*@sumocoders.be'
13+
- '.*@tesuta.be'

config/packages/messenger.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
framework:
22
messenger:
33
# Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
4-
# failure_transport: failed
4+
failure_transport: failed
55

66
transports:
77
# https://symfony.com/doc/current/messenger.html#transport-configuration
8-
# async: '%env(MESSENGER_TRANSPORT_DSN)%'
9-
# failed: 'doctrine://default?queue_name=failed'
8+
async:
9+
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
10+
retry_strategy:
11+
max_retries: 0
12+
failed: 'doctrine://default?queue_name=failed'
1013
# sync: 'sync://'
1114

1215
routing:
1316
# Route your messages to the transports
1417
# 'App\Message\YourMessage': async
1518

19+
when@prod:
20+
framework:
21+
messenger:
22+
routing:
23+
'Symfony\Component\Mailer\Messenger\SendEmailMessage': async
24+
1625
# when@test:
1726
# framework:
1827
# messenger:

config/packages/symfonycasts_sass.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
symfonycasts_sass:
32
root_sass:
43
- '%kernel.project_dir%/assets/styles/style.scss'

config/packages/ux_turbo.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Enable stateless CSRF protection for forms and logins/logouts
2+
framework:
3+
csrf_protection:
4+
check_header: true

config/packages/web_profiler.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ when@dev:
88

99
when@test:
1010
framework:
11-
profiler: { collect: false }
11+
profiler:
12+
collect: false
13+
collect_serializer_data: true

config/routes.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ controllers:
33
path: ../src/Controller/
44
namespace: App\Controller
55
type: attribute
6-
prefix:
7-
nl: ''
6+
prefix: /{_locale}
7+
requirements:
8+
_locale: '%locales_regex%'
9+
trailing_slash_on_root: false

0 commit comments

Comments
 (0)