Private
Public Access
1
0

chg: pkg: make a massive refactor to the backend and remove all unnecessary deps - and make small refactors for the frontend too #4

This commit is contained in:
2026-04-09 20:21:01 +02:00
parent 23547f4237
commit b55c223d8a
55 changed files with 1567 additions and 4398 deletions

View File

@@ -8,19 +8,8 @@ return [
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Sonata\Doctrine\Bridge\Symfony\SonataDoctrineBundle::class => ['all' => true],
Sonata\Exporter\Bridge\Symfony\SonataExporterBundle::class => ['all' => true],
Sonata\Form\Bridge\Symfony\Bundle\SonataFormBundle::class => ['all' => true],
Sonata\Twig\Bridge\Symfony\SonataTwigBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true],
Sonata\UserBundle\SonataUserBundle::class => ['all' => true],
App\Application\Sonata\UserBundle\ApplicationSonataUserBundle::class => ['all' => true],
Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true],
Gos\Bundle\PubSubRouterBundle\GosPubSubRouterBundle::class => ['all' => true],
Gos\Bundle\WebSocketBundle\GosWebSocketBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
];

View File

@@ -16,8 +16,7 @@ doctrine:
collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%'
types:
json: Sonata\Doctrine\Types\JsonType
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
@@ -25,9 +24,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
SonataUserBundle: ~
ApplicationSonataUserBundle: ~

View File

@@ -1,26 +1,14 @@
doctrine:
orm:
metadata_cache_driver:
type: service
id: doctrine.system_cache_provider
type: pool
pool: doctrine.system_cache_pool
query_cache_driver:
type: service
id: doctrine.system_cache_provider
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: service
id: doctrine.result_cache_provider
services:
doctrine.result_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.result_cache_pool'
doctrine.system_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.system_cache_pool'
type: pool
pool: doctrine.result_cache_pool
framework:
cache:
@@ -28,4 +16,4 @@ framework:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system
adapter: cache.system

View File

@@ -1,7 +1,10 @@
security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
in_memory: { memory: ~ }
app_user_provider:
entity:
class: App\Entity\User
property: username
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/

View File

@@ -1,3 +0,0 @@
sensio_framework_extra:
router:
annotations: false

View File

@@ -1,10 +0,0 @@
sonata_admin:
title: 'Sonata Admin'
dashboard:
blocks:
- { type: sonata.admin.block.admin_list, position: left }
sonata_block:
blocks:
sonata.admin.block.admin_list:
contexts: [admin]

View File

@@ -1,3 +0,0 @@
sonata_user:
class:
user: App\Application\Sonata\UserBundle\Entity\User

View File

@@ -0,0 +1,3 @@
_security_logout:
resource: security.route_loader.logout
type: service

View File

@@ -1,8 +0,0 @@
admin_area:
resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
prefix: /admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin

View File

@@ -1,7 +0,0 @@
sonata_user_admin_security:
resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
prefix: /admin
sonata_user_admin_resetting:
resource: '@SonataUserBundle/Resources/config/routing/admin_resetting.xml'
prefix: /admin/resetting

View File

@@ -1,54 +1,65 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: 'en'
jotunheimr.version: 1.1.0-20191026
facebook.api: 320599508311862
facebook.api-secret: 18d4f48cdd274bccee2678e5eff3f557
facebook.version: 'v2.8'
facebook.scope: 'public_profile,email,user_friends'
mineseeker.websocket: 6450
locale: 'en'
jotunheimr.version: 1.1.0-20191026
facebook.api: 320599508311862
facebook.api-secret: 18d4f48cdd274bccee2678e5eff3f557
facebook.version: 'v2.8'
facebook.scope: 'public_profile,email,user_friends'
mineseeker.websocket: 6450
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
public: false # Allows optimizing the container by removing unused services; this also means
# fetching services directly from the container via $container->get() won't work.
# The best practice is to be explicit about your dependencies anyway.
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
public: false # Allows optimizing the container by removing unused services; this also means
# fetching services directly from the container via $container->get() won't work.
# The best practice is to be explicit about your dependencies anyway.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{Entity,Migrations,Tests,Kernel.php,Periodic}'
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{Command/WebsocketServerCommand.php,Entity,Migrations,Tests,Kernel.php,Periodic}'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
tags: [ 'controller.service_arguments' ]
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
mineseeker.topic_sample_service:
class: App\Topic\MineseekerTopic
tags:
- { name: gos_web_socket.topic }
mineseeker.topic_sample_service:
class: App\Topic\MineseekerTopic
tags:
- { name: gos_web_socket.topic }
mineseeker.rpc_sample_service:
class: App\Rpc\MineseekerRpc
public: true
tags:
- { name: gos_web_socket.rpc }
mineseeker.rpc_sample_service:
class: App\Rpc\MineseekerRpc
public: true
tags:
- { name: gos_web_socket.rpc }
gos_web_socket_server.client_event.listener:
class: App\EventListener\MineseekerClientEventListener
tags:
- { name: kernel.event_listener, event: 'gos_web_socket.client_connected', method: onClientConnect }
- { name: kernel.event_listener, event: 'gos_web_socket.client_disconnected', method: onClientDisconnect }
- { name: kernel.event_listener, event: 'gos_web_socket.client_error', method: onClientError }
- { name: kernel.event_listener, event: 'gos_web_socket.server_launched', method: onServerStart }
- { name: kernel.event_listener, event: 'gos_web_socket.client_rejected', method: onClientRejected }
# Override gos WebsocketServerCommand to avoid --profile conflict with Symfony 6.4 global option
gos_web_socket.command.websocket_server:
class: App\Command\WebsocketServerCommand
arguments:
- '@gos_web_socket.server.launcher'
- '%gos_web_socket.server.host%'
- '%gos_web_socket.server.port%'
- '@gos_web_socket.registry.server'
tags:
- { name: console.command, command: 'gos:websocket:server' }
gos_web_socket_server.client_event.listener:
class: App\EventListener\MineseekerClientEventListener
tags:
- { name: kernel.event_listener, event: 'gos_web_socket.client_connected', method: onClientConnect }
- { name: kernel.event_listener, event: 'gos_web_socket.client_disconnected', method: onClientDisconnect }
- { name: kernel.event_listener, event: 'gos_web_socket.client_error', method: onClientError }
- { name: kernel.event_listener, event: 'gos_web_socket.server_launched', method: onServerStart }
- { name: kernel.event_listener, event: 'gos_web_socket.client_rejected', method: onClientRejected }