From 2c740aaf31752e187453eb45bdeac09d3163d11d Mon Sep 17 00:00:00 2001 From: Nathan Boiron Date: Wed, 12 Aug 2026 13:38:15 +0200 Subject: [PATCH] =?UTF-8?q?Migration=20de=20la=20config=20=C3=A0=20la=20ra?= =?UTF-8?q?cine=20du=20projet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour continuer à se rapprocher d'une app Symfony standard. --- .php-cs-fixer.php | 4 +- Makefile | 2 +- app/config/config.yml | 3 -- app/config/config_dev.yml | 39 --------------- app/config/config_prod.yml | 28 ----------- app/config/routing_dev.yml | 14 ------ app/config/services_test.yaml | 11 ----- composer.json | 1 - {app/config => config}/bundles.php | 0 .../packages/asset_mapper.yaml | 6 +-- .../packages/backoffice_menu.yaml | 0 {app/config => config}/packages/doctrine.yaml | 16 +++--- .../packages/ewz_recaptcha.yaml | 4 ++ .../config => config}/packages/framework.yaml | 20 +++++++- .../packages/http_client.yaml | 0 .../packages/knpu_oauth2_client.yaml | 0 {app/config => config}/packages/mailer.yaml | 0 config/packages/monolog.yaml | 49 +++++++++++++++++++ .../packages/parameters.yaml | 9 ++++ .../packages/rate_limiter.yaml | 0 {app/config => config}/packages/security.yaml | 0 .../packages/tiime_new_relic.yaml | 0 {app/config => config}/packages/ting.yaml | 0 {app/config => config}/packages/twig.yaml | 2 +- {app/config => config}/packages/valinor.yaml | 0 config/packages/web_profiler.yaml | 9 ++++ {app/config => config}/reference.php | 2 +- app/config/routing.yml => config/routes.yaml | 15 ++++++ {app/config => config}/routing/admin.yml | 0 .../routing/admin_accounting.yml | 0 .../admin_accounting/configuration.yml | 0 .../configuration/accounts.yml | 0 .../configuration/categories.yml | 0 .../admin_accounting/configuration/events.yml | 0 .../configuration/operations.yml | 0 .../configuration/payments.yml | 0 .../admin_accounting/configuration/rules.yml | 0 .../routing/admin_accounting/journal.yml | 0 .../admin_accounting/membership_fee.yml | 0 .../routing/admin_accounting/produits.yml | 0 .../routing/admin_antennes.yml | 0 .../config => config}/routing/admin_event.yml | 0 .../routing/admin_event_ticket.yml | 0 .../routing/admin_github_user.yml | 0 .../routing/admin_members.yml | 0 .../routing/admin_planete.yml | 0 {app/config => config}/routing/admin_site.yml | 0 .../routing/admin_speaker.yml | 0 .../routing/admin_super_apero.yml | 0 {app/config => config}/routing/admin_talk.yml | 0 {app/config => config}/routing/api.yml | 0 {app/config => config}/routing/auth.yml | 0 {app/config => config}/routing/blog.yml | 0 {app/config => config}/routing/cms_page.yml | 0 {app/config => config}/routing/connection.yml | 0 {app/config => config}/routing/event.yml | 0 {app/config => config}/routing/global.yml | 0 {app/config => config}/routing/meetups.yml | 0 {app/config => config}/routing/member.yml | 0 {app/config => config}/routing/news.yml | 0 {app/config => config}/routing/payment.yml | 0 .../routing/planete_php_api.yml | 0 {app/config => config}/routing/site.yml | 0 {app/config => config}/routing/talks.yml | 0 {app/config => config}/routing/techletter.yml | 0 .../routing/techletter_admin.yml | 0 .../services.yml => config/services.yaml | 16 +++--- .../services_test.yaml | 41 +++++----------- .../AppBundle/Accounting/InvoicingMailer.php | 2 +- sources/AppBundle/AppKernel.php | 12 ++--- .../PostCompilationCopyHandler.php | 2 +- sources/AppBundle/CFP/PhotoStorage.php | 4 +- .../Journal/DownloadAttachmentAction.php | 2 +- .../Journal/DownloadAttachmentsAction.php | 2 +- .../Admin/Accounting/Journal/ImportAction.php | 2 +- .../Journal/UploadAttachmentAction.php | 2 +- .../Admin/Site/AddRubriqueAction.php | 2 +- .../Admin/Site/EditRubriqueAction.php | 2 +- .../Admin/Site/Feuille/AddFeuilleAction.php | 2 +- .../Admin/Site/Feuille/EditFeuilleAction.php | 2 +- .../Event/Invoice/EventInvoiceMailer.php | 2 +- .../MembershipFee/MembershipFeeMailer.php | 2 +- .../SpeakerInfos/SpeakersExpensesStorage.php | 2 +- sources/AppBundle/Twig/AssetsExtension.php | 2 +- 84 files changed, 159 insertions(+), 176 deletions(-) delete mode 100644 app/config/config.yml delete mode 100644 app/config/config_dev.yml delete mode 100644 app/config/config_prod.yml delete mode 100644 app/config/routing_dev.yml delete mode 100644 app/config/services_test.yaml rename {app/config => config}/bundles.php (100%) rename {app/config => config}/packages/asset_mapper.yaml (58%) rename {app/config => config}/packages/backoffice_menu.yaml (100%) rename {app/config => config}/packages/doctrine.yaml (80%) rename {app/config => config}/packages/ewz_recaptcha.yaml (66%) rename {app/config => config}/packages/framework.yaml (69%) rename {app/config => config}/packages/http_client.yaml (100%) rename {app/config => config}/packages/knpu_oauth2_client.yaml (100%) rename {app/config => config}/packages/mailer.yaml (100%) create mode 100644 config/packages/monolog.yaml rename {app/config => config}/packages/parameters.yaml (63%) rename {app/config => config}/packages/rate_limiter.yaml (100%) rename {app/config => config}/packages/security.yaml (100%) rename {app/config => config}/packages/tiime_new_relic.yaml (100%) rename {app/config => config}/packages/ting.yaml (100%) rename {app/config => config}/packages/twig.yaml (82%) rename {app/config => config}/packages/valinor.yaml (100%) create mode 100644 config/packages/web_profiler.yaml rename {app/config => config}/reference.php (99%) rename app/config/routing.yml => config/routes.yaml (82%) rename {app/config => config}/routing/admin.yml (100%) rename {app/config => config}/routing/admin_accounting.yml (100%) rename {app/config => config}/routing/admin_accounting/configuration.yml (100%) rename {app/config => config}/routing/admin_accounting/configuration/accounts.yml (100%) rename {app/config => config}/routing/admin_accounting/configuration/categories.yml (100%) rename {app/config => config}/routing/admin_accounting/configuration/events.yml (100%) rename {app/config => config}/routing/admin_accounting/configuration/operations.yml (100%) rename {app/config => config}/routing/admin_accounting/configuration/payments.yml (100%) rename {app/config => config}/routing/admin_accounting/configuration/rules.yml (100%) rename {app/config => config}/routing/admin_accounting/journal.yml (100%) rename {app/config => config}/routing/admin_accounting/membership_fee.yml (100%) rename {app/config => config}/routing/admin_accounting/produits.yml (100%) rename {app/config => config}/routing/admin_antennes.yml (100%) rename {app/config => config}/routing/admin_event.yml (100%) rename {app/config => config}/routing/admin_event_ticket.yml (100%) rename {app/config => config}/routing/admin_github_user.yml (100%) rename {app/config => config}/routing/admin_members.yml (100%) rename {app/config => config}/routing/admin_planete.yml (100%) rename {app/config => config}/routing/admin_site.yml (100%) rename {app/config => config}/routing/admin_speaker.yml (100%) rename {app/config => config}/routing/admin_super_apero.yml (100%) rename {app/config => config}/routing/admin_talk.yml (100%) rename {app/config => config}/routing/api.yml (100%) rename {app/config => config}/routing/auth.yml (100%) rename {app/config => config}/routing/blog.yml (100%) rename {app/config => config}/routing/cms_page.yml (100%) rename {app/config => config}/routing/connection.yml (100%) rename {app/config => config}/routing/event.yml (100%) rename {app/config => config}/routing/global.yml (100%) rename {app/config => config}/routing/meetups.yml (100%) rename {app/config => config}/routing/member.yml (100%) rename {app/config => config}/routing/news.yml (100%) rename {app/config => config}/routing/payment.yml (100%) rename {app/config => config}/routing/planete_php_api.yml (100%) rename {app/config => config}/routing/site.yml (100%) rename {app/config => config}/routing/talks.yml (100%) rename {app/config => config}/routing/techletter.yml (100%) rename {app/config => config}/routing/techletter_admin.yml (100%) rename app/config/services.yml => config/services.yaml (92%) rename app/config/config_test.yml => config/services_test.yaml (60%) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 742d719b6..e669d89b7 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -5,14 +5,14 @@ $finder = new PhpCsFixer\Finder() ->name('*.php') ->in([ - __DIR__ . '/app', + __DIR__ . '/config', __DIR__ . '/db', __DIR__ . '/htdocs/pages', __DIR__ . '/sources', __DIR__ . '/tests', ]) ->notPath([ - 'config/reference.php', + 'reference.php', ]) ; diff --git a/Makefile b/Makefile index e73fd750b..da23e35ab 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ help: } \ { lastLine = $$0 }' $(MAKEFILE_LIST) -.PHONY: install docker-up docker-stop docker-down test test-functional test-functional-no-js test-functional-js hooks vendors db-seed db-migrations reset-db init console phpstan assets +.PHONY: install docker-up docker-stop docker-down test test-functional test-functional-no-js test-functional-js hooks vendors db-seed db-migrations reset-db init console phpstan assets config ##@ Setup diff --git a/app/config/config.yml b/app/config/config.yml deleted file mode 100644 index 72d530cce..000000000 --- a/app/config/config.yml +++ /dev/null @@ -1,3 +0,0 @@ -imports: - - { resource: services.yml } - - { resource: packages/*.yaml } diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml deleted file mode 100644 index d736d56a0..000000000 --- a/app/config/config_dev.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - - { resource: config.yml } - -framework: - router: - resource: "%kernel.project_dir%/config/routing_dev.yml" - strict_requirements: true - profiler: { only_exceptions: false } - ide: '%env(default::resolve:SYMFONY_IDE)%' - -web_profiler: - toolbar: true - intercept_redirects: false - -monolog: - handlers: - main: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug - channels: ["!event"] - console: - type: console - channels: ["!event", "!doctrine"] - # uncomment to get logging in your browser - # you may have to allow bigger header sizes in your Web server configuration - #firephp: - # type: firephp - # level: info - #chromephp: - # type: chromephp - # level: info - -parameters: - paybox_ips: [127.0.0.1, 192.168.42.1] - database_host: "db" - -#swiftmailer: -# delivery_address: me@example.com diff --git a/app/config/config_prod.yml b/app/config/config_prod.yml deleted file mode 100644 index e468aa315..000000000 --- a/app/config/config_prod.yml +++ /dev/null @@ -1,28 +0,0 @@ -imports: - - { resource: config.yml } - -parameters: - database_host: "%env(DATABASE_HOST)%" - -#doctrine: -# orm: -# metadata_cache_driver: apc -# result_cache_driver: apc -# query_cache_driver: apc - -monolog: - handlers: - main: - type: fingers_crossed - excluded_http_codes: [404] - action_level: error - handler: nested - nested: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug - syslog_handler: - type: syslog - level: error - console: - type: console diff --git a/app/config/routing_dev.yml b/app/config/routing_dev.yml deleted file mode 100644 index 5dc13700c..000000000 --- a/app/config/routing_dev.yml +++ /dev/null @@ -1,14 +0,0 @@ -_wdt: - resource: "@WebProfilerBundle/Resources/config/routing/wdt.php" - prefix: /_wdt - -_profiler: - resource: "@WebProfilerBundle/Resources/config/routing/profiler.php" - prefix: /_profiler - -_errors: - resource: "@FrameworkBundle/Resources/config/routing/errors.php" - prefix: /_error - -_main: - resource: routing.yml diff --git a/app/config/services_test.yaml b/app/config/services_test.yaml deleted file mode 100644 index b1924aa42..000000000 --- a/app/config/services_test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -services: - AppBundle\Listener\DetectClockMockingListener: - autowire: true - tags: - - { name: kernel.event_listener, priority: 1000 } - - http_client.bluesky_embed: - class: Symfony\Component\HttpClient\MockHttpClient - - Afup\Tests\Support\Wordpress\FakeWordpressClient: ~ - AppBundle\Event\Wordpress\WordpressClient: '@Afup\Tests\Support\Wordpress\FakeWordpressClient' diff --git a/composer.json b/composer.json index e224447a7..cddafe3ec 100644 --- a/composer.json +++ b/composer.json @@ -105,7 +105,6 @@ "patches/setasign-tfpdf-tfpdf-php.patch" ] }, - "symfony-app-dir": "app", "symfony-web-dir": "htdocs", "symfony-bin-dir": "bin", "symfony-var-dir": "var", diff --git a/app/config/bundles.php b/config/bundles.php similarity index 100% rename from app/config/bundles.php rename to config/bundles.php diff --git a/app/config/packages/asset_mapper.yaml b/config/packages/asset_mapper.yaml similarity index 58% rename from app/config/packages/asset_mapper.yaml rename to config/packages/asset_mapper.yaml index 1c3088ee7..286361aaa 100644 --- a/app/config/packages/asset_mapper.yaml +++ b/config/packages/asset_mapper.yaml @@ -2,10 +2,10 @@ framework: asset_mapper: # The paths to make available to the asset mapper. paths: - - '%kernel.project_dir%/../assets/' - importmap_path: '%kernel.project_dir%/../importmap.php' + - '%kernel.project_dir%/assets/' + importmap_path: '%kernel.project_dir%/importmap.php' missing_import_mode: strict - vendor_dir: '%kernel.project_dir%/../assets/vendor' + vendor_dir: '%kernel.project_dir%/assets/vendor' public_prefix: /dist/ when@prod: diff --git a/app/config/packages/backoffice_menu.yaml b/config/packages/backoffice_menu.yaml similarity index 100% rename from app/config/packages/backoffice_menu.yaml rename to config/packages/backoffice_menu.yaml diff --git a/app/config/packages/doctrine.yaml b/config/packages/doctrine.yaml similarity index 80% rename from app/config/packages/doctrine.yaml rename to config/packages/doctrine.yaml index ae678d01e..4cea6821e 100644 --- a/app/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -29,42 +29,42 @@ doctrine: Association: type: attribute is_bundle: false - dir: '%kernel.project_dir%/../sources/AppBundle/Association/Entity' + dir: '%kernel.project_dir%/sources/AppBundle/Association/Entity' prefix: 'AppBundle\Association\Entity' AssembleeGenerale: type: attribute is_bundle: false - dir: '%kernel.project_dir%/../sources/AppBundle/AssembleeGenerale/Entity' + dir: '%kernel.project_dir%/sources/AppBundle/AssembleeGenerale/Entity' prefix: 'AppBundle\AssembleeGenerale\Entity' Accounting: type: attribute is_bundle: false - dir: '%kernel.project_dir%/../sources/AppBundle/Accounting/Entity' + dir: '%kernel.project_dir%/sources/AppBundle/Accounting/Entity' prefix: 'AppBundle\Accounting\Entity' Site: type: attribute is_bundle: false - dir: '%kernel.project_dir%/../sources/AppBundle/Site/Entity' + dir: '%kernel.project_dir%/sources/AppBundle/Site/Entity' prefix: 'AppBundle\Site\Entity' SuperApero: type: attribute is_bundle: false - dir: '%kernel.project_dir%/../sources/AppBundle/SuperApero/Entity' + dir: '%kernel.project_dir%/sources/AppBundle/SuperApero/Entity' prefix: 'AppBundle\SuperApero\Entity' Veille: type: attribute is_bundle: false - dir: '%kernel.project_dir%/../sources/AppBundle/Veille/Entity' + dir: '%kernel.project_dir%/sources/AppBundle/Veille/Entity' prefix: 'AppBundle\Veille\Entity' Event: type: attribute is_bundle: false - dir: '%kernel.project_dir%/../sources/AppBundle/Event/Entity' + dir: '%kernel.project_dir%/sources/AppBundle/Event/Entity' prefix: 'AppBundle\Event\Entity' PlanetePHP: type: attribute is_bundle: false - dir: '%kernel.project_dir%/../sources/PlanetePHP' + dir: '%kernel.project_dir%/sources/PlanetePHP' prefix: 'PlanetePHP' when@test: diff --git a/app/config/packages/ewz_recaptcha.yaml b/config/packages/ewz_recaptcha.yaml similarity index 66% rename from app/config/packages/ewz_recaptcha.yaml rename to config/packages/ewz_recaptcha.yaml index dafd6d6a7..45a52fa2d 100644 --- a/app/config/packages/ewz_recaptcha.yaml +++ b/config/packages/ewz_recaptcha.yaml @@ -1,3 +1,7 @@ ewz_recaptcha: public_key: '%env(RECAPTCHA_PUBLIC_KEY)%' private_key: '%env(RECAPTCHA_PRIVATE_KEY)%' + +when@test: + ewz_recaptcha: + enabled: false diff --git a/app/config/packages/framework.yaml b/config/packages/framework.yaml similarity index 69% rename from app/config/packages/framework.yaml rename to config/packages/framework.yaml index 1803697bf..41aeca759 100644 --- a/app/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -3,10 +3,9 @@ framework: translator: fallbacks: ["%locale%"] enabled: true - default_path: "%kernel.project_dir%/../translations" + default_path: "%kernel.project_dir%/translations" secret: "%env(SECRET)%" router: - resource: "%kernel.project_dir%/config/routing.yml" strict_requirements: ~ utf8: true form: ~ @@ -33,3 +32,20 @@ framework: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: log_level: debug status_code: 404 + +when@dev: + framework: + router: + strict_requirements: true + profiler: { only_exceptions: false } + ide: '%env(default::resolve:SYMFONY_IDE)%' + +when@test: + framework: + test: ~ + router: + strict_requirements: true + profiler: + only_exceptions: false + collect: false + ide: '%env(default::resolve:SYMFONY_IDE)%' diff --git a/app/config/packages/http_client.yaml b/config/packages/http_client.yaml similarity index 100% rename from app/config/packages/http_client.yaml rename to config/packages/http_client.yaml diff --git a/app/config/packages/knpu_oauth2_client.yaml b/config/packages/knpu_oauth2_client.yaml similarity index 100% rename from app/config/packages/knpu_oauth2_client.yaml rename to config/packages/knpu_oauth2_client.yaml diff --git a/app/config/packages/mailer.yaml b/config/packages/mailer.yaml similarity index 100% rename from app/config/packages/mailer.yaml rename to config/packages/mailer.yaml diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml new file mode 100644 index 000000000..68af0e7c4 --- /dev/null +++ b/config/packages/monolog.yaml @@ -0,0 +1,49 @@ +when@dev: + monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] + console: + type: console + channels: ["!event", "!doctrine"] + +when@test: + monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] + console: + type: console + channels: ["!event", "!doctrine"] + deprecation_stream: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log" + deprecation_filter: + type: filter + handler: deprecation_stream + max_level: info + channels: ["php"] + +when@prod: + monolog: + handlers: + main: + type: fingers_crossed + excluded_http_codes: [404] + action_level: error + handler: nested + nested: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + syslog_handler: + type: syslog + level: error + console: + type: console diff --git a/app/config/packages/parameters.yaml b/config/packages/parameters.yaml similarity index 63% rename from app/config/packages/parameters.yaml rename to config/packages/parameters.yaml index 0ab9b9c2f..38d72b4e6 100644 --- a/app/config/packages/parameters.yaml +++ b/config/packages/parameters.yaml @@ -1,5 +1,6 @@ parameters: locale: fr + database_host: "%env(DATABASE_HOST)%" github_authenticator: "AppBundle\\Security\\GithubAuthenticator" paybox_ips: - '194.2.122.158' @@ -20,3 +21,11 @@ parameters: - '195.25.7.157' - '195.25.7.159' - '195.25.7.166' + +when@dev: + parameters: + paybox_ips: [127.0.0.1, 192.168.42.1] + database_host: "db" + +# Les paramètres de l'environnement de test sont dans config/services_test.yaml : ce fichier est +# chargé après config/services.yaml, qui redéfinit database_name/user/password/port. diff --git a/app/config/packages/rate_limiter.yaml b/config/packages/rate_limiter.yaml similarity index 100% rename from app/config/packages/rate_limiter.yaml rename to config/packages/rate_limiter.yaml diff --git a/app/config/packages/security.yaml b/config/packages/security.yaml similarity index 100% rename from app/config/packages/security.yaml rename to config/packages/security.yaml diff --git a/app/config/packages/tiime_new_relic.yaml b/config/packages/tiime_new_relic.yaml similarity index 100% rename from app/config/packages/tiime_new_relic.yaml rename to config/packages/tiime_new_relic.yaml diff --git a/app/config/packages/ting.yaml b/config/packages/ting.yaml similarity index 100% rename from app/config/packages/ting.yaml rename to config/packages/ting.yaml diff --git a/app/config/packages/twig.yaml b/config/packages/twig.yaml similarity index 82% rename from app/config/packages/twig.yaml rename to config/packages/twig.yaml index 7896898b1..a5223d184 100644 --- a/app/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -5,4 +5,4 @@ twig: photo_storage: '@AppBundle\CFP\PhotoStorage' global_menu_event_label: '%env(AFUP_GLOBAL_MENU_EVENT_LABEL)%' form_themes: ['form_theme.html.twig'] - default_path: "%kernel.project_dir%/../templates" + default_path: "%kernel.project_dir%/templates" diff --git a/app/config/packages/valinor.yaml b/config/packages/valinor.yaml similarity index 100% rename from app/config/packages/valinor.yaml rename to config/packages/valinor.yaml diff --git a/config/packages/web_profiler.yaml b/config/packages/web_profiler.yaml new file mode 100644 index 000000000..d6bc1888e --- /dev/null +++ b/config/packages/web_profiler.yaml @@ -0,0 +1,9 @@ +when@dev: + web_profiler: + toolbar: true + intercept_redirects: false + +when@test: + web_profiler: + toolbar: false + intercept_redirects: false diff --git a/app/config/reference.php b/config/reference.php similarity index 99% rename from app/config/reference.php rename to config/reference.php index d06f58d5e..3e9328a2e 100644 --- a/app/config/reference.php +++ b/config/reference.php @@ -1042,7 +1042,7 @@ * enabled?: bool|Param, // Default: false * }, * html?: bool|array{ - * enabled?: bool|Param, // Default: false + * enabled?: bool|Param, // Default: true * }, * markdown?: bool|array{ * enabled?: bool|Param, // Default: true diff --git a/app/config/routing.yml b/config/routes.yaml similarity index 82% rename from app/config/routing.yml rename to config/routes.yaml index 5896a9f8e..bfad7a91b 100644 --- a/app/config/routing.yml +++ b/config/routes.yaml @@ -86,3 +86,18 @@ global: auth: resource: "routing/auth.yml" + +when@dev: &profiler_routes + _wdt: + resource: "@WebProfilerBundle/Resources/config/routing/wdt.php" + prefix: /_wdt + + _profiler: + resource: "@WebProfilerBundle/Resources/config/routing/profiler.php" + prefix: /_profiler + + _errors: + resource: "@FrameworkBundle/Resources/config/routing/errors.php" + prefix: /_error + +when@test: *profiler_routes diff --git a/app/config/routing/admin.yml b/config/routing/admin.yml similarity index 100% rename from app/config/routing/admin.yml rename to config/routing/admin.yml diff --git a/app/config/routing/admin_accounting.yml b/config/routing/admin_accounting.yml similarity index 100% rename from app/config/routing/admin_accounting.yml rename to config/routing/admin_accounting.yml diff --git a/app/config/routing/admin_accounting/configuration.yml b/config/routing/admin_accounting/configuration.yml similarity index 100% rename from app/config/routing/admin_accounting/configuration.yml rename to config/routing/admin_accounting/configuration.yml diff --git a/app/config/routing/admin_accounting/configuration/accounts.yml b/config/routing/admin_accounting/configuration/accounts.yml similarity index 100% rename from app/config/routing/admin_accounting/configuration/accounts.yml rename to config/routing/admin_accounting/configuration/accounts.yml diff --git a/app/config/routing/admin_accounting/configuration/categories.yml b/config/routing/admin_accounting/configuration/categories.yml similarity index 100% rename from app/config/routing/admin_accounting/configuration/categories.yml rename to config/routing/admin_accounting/configuration/categories.yml diff --git a/app/config/routing/admin_accounting/configuration/events.yml b/config/routing/admin_accounting/configuration/events.yml similarity index 100% rename from app/config/routing/admin_accounting/configuration/events.yml rename to config/routing/admin_accounting/configuration/events.yml diff --git a/app/config/routing/admin_accounting/configuration/operations.yml b/config/routing/admin_accounting/configuration/operations.yml similarity index 100% rename from app/config/routing/admin_accounting/configuration/operations.yml rename to config/routing/admin_accounting/configuration/operations.yml diff --git a/app/config/routing/admin_accounting/configuration/payments.yml b/config/routing/admin_accounting/configuration/payments.yml similarity index 100% rename from app/config/routing/admin_accounting/configuration/payments.yml rename to config/routing/admin_accounting/configuration/payments.yml diff --git a/app/config/routing/admin_accounting/configuration/rules.yml b/config/routing/admin_accounting/configuration/rules.yml similarity index 100% rename from app/config/routing/admin_accounting/configuration/rules.yml rename to config/routing/admin_accounting/configuration/rules.yml diff --git a/app/config/routing/admin_accounting/journal.yml b/config/routing/admin_accounting/journal.yml similarity index 100% rename from app/config/routing/admin_accounting/journal.yml rename to config/routing/admin_accounting/journal.yml diff --git a/app/config/routing/admin_accounting/membership_fee.yml b/config/routing/admin_accounting/membership_fee.yml similarity index 100% rename from app/config/routing/admin_accounting/membership_fee.yml rename to config/routing/admin_accounting/membership_fee.yml diff --git a/app/config/routing/admin_accounting/produits.yml b/config/routing/admin_accounting/produits.yml similarity index 100% rename from app/config/routing/admin_accounting/produits.yml rename to config/routing/admin_accounting/produits.yml diff --git a/app/config/routing/admin_antennes.yml b/config/routing/admin_antennes.yml similarity index 100% rename from app/config/routing/admin_antennes.yml rename to config/routing/admin_antennes.yml diff --git a/app/config/routing/admin_event.yml b/config/routing/admin_event.yml similarity index 100% rename from app/config/routing/admin_event.yml rename to config/routing/admin_event.yml diff --git a/app/config/routing/admin_event_ticket.yml b/config/routing/admin_event_ticket.yml similarity index 100% rename from app/config/routing/admin_event_ticket.yml rename to config/routing/admin_event_ticket.yml diff --git a/app/config/routing/admin_github_user.yml b/config/routing/admin_github_user.yml similarity index 100% rename from app/config/routing/admin_github_user.yml rename to config/routing/admin_github_user.yml diff --git a/app/config/routing/admin_members.yml b/config/routing/admin_members.yml similarity index 100% rename from app/config/routing/admin_members.yml rename to config/routing/admin_members.yml diff --git a/app/config/routing/admin_planete.yml b/config/routing/admin_planete.yml similarity index 100% rename from app/config/routing/admin_planete.yml rename to config/routing/admin_planete.yml diff --git a/app/config/routing/admin_site.yml b/config/routing/admin_site.yml similarity index 100% rename from app/config/routing/admin_site.yml rename to config/routing/admin_site.yml diff --git a/app/config/routing/admin_speaker.yml b/config/routing/admin_speaker.yml similarity index 100% rename from app/config/routing/admin_speaker.yml rename to config/routing/admin_speaker.yml diff --git a/app/config/routing/admin_super_apero.yml b/config/routing/admin_super_apero.yml similarity index 100% rename from app/config/routing/admin_super_apero.yml rename to config/routing/admin_super_apero.yml diff --git a/app/config/routing/admin_talk.yml b/config/routing/admin_talk.yml similarity index 100% rename from app/config/routing/admin_talk.yml rename to config/routing/admin_talk.yml diff --git a/app/config/routing/api.yml b/config/routing/api.yml similarity index 100% rename from app/config/routing/api.yml rename to config/routing/api.yml diff --git a/app/config/routing/auth.yml b/config/routing/auth.yml similarity index 100% rename from app/config/routing/auth.yml rename to config/routing/auth.yml diff --git a/app/config/routing/blog.yml b/config/routing/blog.yml similarity index 100% rename from app/config/routing/blog.yml rename to config/routing/blog.yml diff --git a/app/config/routing/cms_page.yml b/config/routing/cms_page.yml similarity index 100% rename from app/config/routing/cms_page.yml rename to config/routing/cms_page.yml diff --git a/app/config/routing/connection.yml b/config/routing/connection.yml similarity index 100% rename from app/config/routing/connection.yml rename to config/routing/connection.yml diff --git a/app/config/routing/event.yml b/config/routing/event.yml similarity index 100% rename from app/config/routing/event.yml rename to config/routing/event.yml diff --git a/app/config/routing/global.yml b/config/routing/global.yml similarity index 100% rename from app/config/routing/global.yml rename to config/routing/global.yml diff --git a/app/config/routing/meetups.yml b/config/routing/meetups.yml similarity index 100% rename from app/config/routing/meetups.yml rename to config/routing/meetups.yml diff --git a/app/config/routing/member.yml b/config/routing/member.yml similarity index 100% rename from app/config/routing/member.yml rename to config/routing/member.yml diff --git a/app/config/routing/news.yml b/config/routing/news.yml similarity index 100% rename from app/config/routing/news.yml rename to config/routing/news.yml diff --git a/app/config/routing/payment.yml b/config/routing/payment.yml similarity index 100% rename from app/config/routing/payment.yml rename to config/routing/payment.yml diff --git a/app/config/routing/planete_php_api.yml b/config/routing/planete_php_api.yml similarity index 100% rename from app/config/routing/planete_php_api.yml rename to config/routing/planete_php_api.yml diff --git a/app/config/routing/site.yml b/config/routing/site.yml similarity index 100% rename from app/config/routing/site.yml rename to config/routing/site.yml diff --git a/app/config/routing/talks.yml b/config/routing/talks.yml similarity index 100% rename from app/config/routing/talks.yml rename to config/routing/talks.yml diff --git a/app/config/routing/techletter.yml b/config/routing/techletter.yml similarity index 100% rename from app/config/routing/techletter.yml rename to config/routing/techletter.yml diff --git a/app/config/routing/techletter_admin.yml b/config/routing/techletter_admin.yml similarity index 100% rename from app/config/routing/techletter_admin.yml rename to config/routing/techletter_admin.yml diff --git a/app/config/services.yml b/config/services.yaml similarity index 92% rename from app/config/services.yml rename to config/services.yaml index 347c7e020..725de78d4 100644 --- a/app/config/services.yml +++ b/config/services.yaml @@ -1,9 +1,9 @@ # Learn more about services, parameters and containers at # http://symfony.com/doc/current/book/service_container.html parameters: - app.badge_dir: "%kernel.project_dir%/../htdocs/uploads/badges" - app.members_logo_dir: "%kernel.project_dir%/../htdocs/uploads/members_logo" - app.general_meetings_dir: "%kernel.project_dir%/../htdocs/uploads/general_meetings_reports" + app.badge_dir: "%kernel.project_dir%/htdocs/uploads/badges" + app.members_logo_dir: "%kernel.project_dir%/htdocs/uploads/members_logo" + app.general_meetings_dir: "%kernel.project_dir%/htdocs/uploads/general_meetings_reports" bluesky.api.identifier: "%env(BLUESKY_API_IDENTIFIER)%" bluesky.api.app_password: "%env(BLUESKY_API_APP_PASSWORD)%" database_name: "%env(DATABASE_NAME)%" @@ -41,25 +41,25 @@ services: Laminas\Feed\Reader\Http\ClientInterface: '@PlanetePHP\SymfonyFeedClient' AppBundle\: - resource: '../../sources/AppBundle/' + resource: '../sources/AppBundle/' autowire: true autoconfigure: true public: false AppBundle\Command\: - resource: '../../sources/AppBundle/Command/' + resource: '../sources/AppBundle/Command/' autowire: true autoconfigure: true public: true AppBundle\Controller\: - resource: '../../sources/AppBundle/Controller/' + resource: '../sources/AppBundle/Controller/' autowire: true autoconfigure: true public: true PlanetePHP\: - resource: '../../sources/PlanetePHP' + resource: '../sources/PlanetePHP' autowire: true autoconfigure: true public: false @@ -200,6 +200,6 @@ services: asset_mapper.compiled_asset_mapper_config_reader: class: Symfony\Component\AssetMapper\CompiledAssetMapperConfigReader arguments: - $directory: '%kernel.project_dir%/../htdocs/dist' + $directory: '%kernel.project_dir%/htdocs/dist' AppBundle\Event\Wordpress\WordpressClient: '@AppBundle\Event\Wordpress\HttpWordpressClient' diff --git a/app/config/config_test.yml b/config/services_test.yaml similarity index 60% rename from app/config/config_test.yml rename to config/services_test.yaml index 73feec2da..6c7f80480 100644 --- a/app/config/config_test.yml +++ b/config/services_test.yaml @@ -1,17 +1,5 @@ -imports: - - { resource: config_dev.yml } - - { resource: services_test.yaml } - -framework: - test: ~ - profiler: - collect: false - -web_profiler: - toolbar: false - intercept_redirects: false - parameters: + paybox_ips: [127.0.0.1, 192.168.42.1] database_host: dbtest database_port: 3306 database_name: web @@ -27,6 +15,17 @@ parameters: smtp_port: 1025 services: + AppBundle\Listener\DetectClockMockingListener: + autowire: true + tags: + - { name: kernel.event_listener, priority: 1000 } + + http_client.bluesky_embed: + class: Symfony\Component\HttpClient\MockHttpClient + + Afup\Tests\Support\Wordpress\FakeWordpressClient: ~ + AppBundle\Event\Wordpress\WordpressClient: '@Afup\Tests\Support\Wordpress\FakeWordpressClient' + AppBundle\Offices\OfficeFinder: class: AppBundle\Offices\NullOfficeFinder autowire: true @@ -40,19 +39,3 @@ services: PlanetePHP\SymfonyFeedClient: arguments: $httpClient: '@planetephp.http_client' - -ewz_recaptcha: - enabled: false - - -monolog: - handlers: - deprecation_stream: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log" - - deprecation_filter: - type: filter - handler: deprecation_stream - max_level: info - channels: ["php"] diff --git a/sources/AppBundle/Accounting/InvoicingMailer.php b/sources/AppBundle/Accounting/InvoicingMailer.php index 7037fd2f1..59d0d04d1 100644 --- a/sources/AppBundle/Accounting/InvoicingMailer.php +++ b/sources/AppBundle/Accounting/InvoicingMailer.php @@ -17,7 +17,7 @@ public function __construct( private InvoicingPdfGenerator $pdfGenerator, private Mailer $mailer, - #[Autowire('%kernel.project_dir%/../htdocs/cache/')] + #[Autowire('%kernel.project_dir%/htdocs/cache/')] private string $publicCacheDir, ) {} diff --git a/sources/AppBundle/AppKernel.php b/sources/AppBundle/AppKernel.php index e96738deb..20f0622fc 100644 --- a/sources/AppBundle/AppKernel.php +++ b/sources/AppBundle/AppKernel.php @@ -7,7 +7,6 @@ use AppBundle\DependencyInjection\ControllersWithEventSelectorPass; use AppBundle\DependencyInjection\TingRepositoryPass; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; -use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel; @@ -18,24 +17,19 @@ class AppKernel extends Kernel #[\Override] public function getProjectDir(): string { - return __DIR__ . '/../../app'; + return __DIR__ . '/../..'; } #[\Override] public function getCacheDir(): string { - return __DIR__ . '/../../var/cache/' . $this->getEnvironment(); + return $this->getProjectDir() . '/var/cache/' . $this->getEnvironment(); } #[\Override] public function getLogDir(): string { - return __DIR__ . '/../../var/logs'; - } - - public function registerContainerConfiguration(LoaderInterface $loader): void - { - $loader->load(__DIR__ . '/../../app/config/config_' . $this->getEnvironment() . '.yml'); + return $this->getProjectDir() . '/var/logs'; } protected function build(ContainerBuilder $container): void diff --git a/sources/AppBundle/AssetMapper/PostCompilationCopyHandler.php b/sources/AppBundle/AssetMapper/PostCompilationCopyHandler.php index 208f9768d..2cd9bd4d6 100644 --- a/sources/AppBundle/AssetMapper/PostCompilationCopyHandler.php +++ b/sources/AppBundle/AssetMapper/PostCompilationCopyHandler.php @@ -20,7 +20,7 @@ class PostCompilationCopyHandler implements PublicAssetsFilesystemInterface * @param string[] $extensionsToCompress */ public function __construct( - #[Autowire('%kernel.project_dir%/../htdocs')] + #[Autowire('%kernel.project_dir%/htdocs')] private readonly string $publicDir, private readonly ?CompressorInterface $compressor = null, private readonly array $extensionsToCompress = [], diff --git a/sources/AppBundle/CFP/PhotoStorage.php b/sources/AppBundle/CFP/PhotoStorage.php index 89be053ce..232040af5 100644 --- a/sources/AppBundle/CFP/PhotoStorage.php +++ b/sources/AppBundle/CFP/PhotoStorage.php @@ -27,9 +27,9 @@ ]; public function __construct( - #[Autowire('%kernel.project_dir%/../htdocs/uploads/speakers')] + #[Autowire('%kernel.project_dir%/htdocs/uploads/speakers')] private string $basePath, - #[Autowire('%kernel.project_dir%/../htdocs')] + #[Autowire('%kernel.project_dir%/htdocs')] private string $legacyBasePath, ) { $this->filesystem = new Filesystem(); diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentAction.php index 84bb6574a..338aa0d4b 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentAction.php @@ -16,7 +16,7 @@ class DownloadAttachmentAction extends AbstractController { public function __construct( private readonly TransactionRepository $accountingRepository, - #[Autowire('%kernel.project_dir%/../htdocs/uploads/')] + #[Autowire('%kernel.project_dir%/htdocs/uploads/')] private readonly string $uploadDir, ) {} diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentsAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentsAction.php index 768a113a0..39175dc84 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentsAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/DownloadAttachmentsAction.php @@ -19,7 +19,7 @@ class DownloadAttachmentsAction extends AbstractController { public function __construct( private readonly InvoicingPeriodRepository $invoicingPeriodRepository, - #[Autowire('%kernel.project_dir%/../htdocs/uploads/')] private readonly string $uploadDir, + #[Autowire('%kernel.project_dir%/htdocs/uploads/')] private readonly string $uploadDir, ) {} public function __invoke(Request $request): Response diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/ImportAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/ImportAction.php index 3e9c7ca09..e58b86fa4 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/ImportAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/ImportAction.php @@ -20,7 +20,7 @@ public function __construct( private readonly Audit $audit, private readonly Factory $importerFactory, private readonly CsvExtractor $csvExtractor, - #[Autowire('%kernel.project_dir%/../tmp/')] + #[Autowire('%kernel.project_dir%/tmp/')] private readonly string $uploadDir, ) {} diff --git a/sources/AppBundle/Controller/Admin/Accounting/Journal/UploadAttachmentAction.php b/sources/AppBundle/Controller/Admin/Accounting/Journal/UploadAttachmentAction.php index 3416ac3af..046db6b2b 100644 --- a/sources/AppBundle/Controller/Admin/Accounting/Journal/UploadAttachmentAction.php +++ b/sources/AppBundle/Controller/Admin/Accounting/Journal/UploadAttachmentAction.php @@ -19,7 +19,7 @@ class UploadAttachmentAction extends AbstractController public function __construct( private readonly TransactionRepository $transactionRepository, private readonly ValidatorInterface $validator, - #[Autowire('%kernel.project_dir%/../htdocs/uploads/')] private readonly string $uploadDir, + #[Autowire('%kernel.project_dir%/htdocs/uploads/')] private readonly string $uploadDir, ) {} public function __invoke(Request $request, int $id): Response diff --git a/sources/AppBundle/Controller/Admin/Site/AddRubriqueAction.php b/sources/AppBundle/Controller/Admin/Site/AddRubriqueAction.php index 9f3ce9736..3a3948bbf 100644 --- a/sources/AppBundle/Controller/Admin/Site/AddRubriqueAction.php +++ b/sources/AppBundle/Controller/Admin/Site/AddRubriqueAction.php @@ -17,7 +17,7 @@ final class AddRubriqueAction extends AbstractController { public function __construct( private readonly RubriqueRepository $rubriqueRepository, - #[Autowire('%kernel.project_dir%/../htdocs/templates/site/images')] + #[Autowire('%kernel.project_dir%/htdocs/templates/site/images')] private readonly string $storageDir, private readonly Audit $audit, ) {} diff --git a/sources/AppBundle/Controller/Admin/Site/EditRubriqueAction.php b/sources/AppBundle/Controller/Admin/Site/EditRubriqueAction.php index ae77b756c..d7ff6089e 100644 --- a/sources/AppBundle/Controller/Admin/Site/EditRubriqueAction.php +++ b/sources/AppBundle/Controller/Admin/Site/EditRubriqueAction.php @@ -16,7 +16,7 @@ final class EditRubriqueAction extends AbstractController { public function __construct( private readonly RubriqueRepository $rubriqueRepository, - #[Autowire('%kernel.project_dir%/../htdocs/templates/site/images')] + #[Autowire('%kernel.project_dir%/htdocs/templates/site/images')] private readonly string $storageDir, private readonly Audit $audit, ) {} diff --git a/sources/AppBundle/Controller/Admin/Site/Feuille/AddFeuilleAction.php b/sources/AppBundle/Controller/Admin/Site/Feuille/AddFeuilleAction.php index 0e73422d6..d5772b108 100644 --- a/sources/AppBundle/Controller/Admin/Site/Feuille/AddFeuilleAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Feuille/AddFeuilleAction.php @@ -19,7 +19,7 @@ final class AddFeuilleAction extends AbstractController public function __construct( private readonly FeuilleRepository $feuilleRepository, private readonly Audit $audit, - #[Autowire('%kernel.project_dir%/../htdocs/templates/site/images')] + #[Autowire('%kernel.project_dir%/htdocs/templates/site/images')] private readonly string $storageDir, ) {} diff --git a/sources/AppBundle/Controller/Admin/Site/Feuille/EditFeuilleAction.php b/sources/AppBundle/Controller/Admin/Site/Feuille/EditFeuilleAction.php index 7a32fbb4c..9eabcedb3 100644 --- a/sources/AppBundle/Controller/Admin/Site/Feuille/EditFeuilleAction.php +++ b/sources/AppBundle/Controller/Admin/Site/Feuille/EditFeuilleAction.php @@ -18,7 +18,7 @@ final class EditFeuilleAction extends AbstractController public function __construct( private readonly FeuilleRepository $feuilleRepository, private readonly Audit $audit, - #[Autowire('%kernel.project_dir%/../htdocs/templates/site/images')] + #[Autowire('%kernel.project_dir%/htdocs/templates/site/images')] private readonly string $storageDir, ) {} diff --git a/sources/AppBundle/Event/Invoice/EventInvoiceMailer.php b/sources/AppBundle/Event/Invoice/EventInvoiceMailer.php index ae0e73851..59829eb28 100644 --- a/sources/AppBundle/Event/Invoice/EventInvoiceMailer.php +++ b/sources/AppBundle/Event/Invoice/EventInvoiceMailer.php @@ -20,7 +20,7 @@ public function __construct( private readonly InvoiceRepository $invoiceRepository, private readonly Mailer $mailer, private readonly InvoiceService $invoiceService, - #[Autowire('%kernel.project_dir%/../htdocs/cache/')] + #[Autowire('%kernel.project_dir%/htdocs/cache/')] private readonly string $publicCacheDir, ) {} diff --git a/sources/AppBundle/MembershipFee/MembershipFeeMailer.php b/sources/AppBundle/MembershipFee/MembershipFeeMailer.php index d7edb3285..aa68800ad 100644 --- a/sources/AppBundle/MembershipFee/MembershipFeeMailer.php +++ b/sources/AppBundle/MembershipFee/MembershipFeeMailer.php @@ -25,7 +25,7 @@ public function __construct( private CompanyMemberRepository $companyMemberRepository, private Mailer $mailer, private MembershipFeeInvoicePdfGenerator $pdfGenerator, - #[Autowire('%kernel.project_dir%/../htdocs/cache/')] + #[Autowire('%kernel.project_dir%/htdocs/cache/')] private string $publicCacheDir, ) {} diff --git a/sources/AppBundle/SpeakerInfos/SpeakersExpensesStorage.php b/sources/AppBundle/SpeakerInfos/SpeakersExpensesStorage.php index 87f25b097..3ef589d6e 100644 --- a/sources/AppBundle/SpeakerInfos/SpeakersExpensesStorage.php +++ b/sources/AppBundle/SpeakerInfos/SpeakersExpensesStorage.php @@ -19,7 +19,7 @@ private Filesystem $filesystem; public function __construct( - #[Autowire('%kernel.project_dir%/../htdocs/uploads/speaker_expenses')] + #[Autowire('%kernel.project_dir%/htdocs/uploads/speaker_expenses')] private string $basePath, private EventRepository $eventRepository, private LoggerInterface $logger, diff --git a/sources/AppBundle/Twig/AssetsExtension.php b/sources/AppBundle/Twig/AssetsExtension.php index b463bef76..841744016 100644 --- a/sources/AppBundle/Twig/AssetsExtension.php +++ b/sources/AppBundle/Twig/AssetsExtension.php @@ -20,7 +20,7 @@ public function getFunctions(): array { return [ new TwigFunction('asset_md5_start', function (string $url) { - $path = $this->kernelProjectDir . '/../htdocs/' . $url; + $path = $this->kernelProjectDir . '/htdocs/' . $url; return substr(md5_file($path), 0, 8); }, ['is_safe' => ['html']]),