Browse Source

fix api platform bug and add services/*.yaml

Olivier Massot 2 năm trước cách đây
mục cha
commit
97371ba682
4 tập tin đã thay đổi với 36 bổ sung34 xóa
  1. 1 1
      composer.json
  2. 7 33
      config/services.yaml
  3. 21 0
      config/services/api-platform.yaml
  4. 7 0
      config/services/monolog.yaml

+ 1 - 1
composer.json

@@ -11,7 +11,7 @@
         "php": ">=8.1",
         "ext-ctype": "*",
         "ext-iconv": "*",
-        "api-platform/core": "^3.1",
+        "api-platform/core": "3.1.7",
         "beberlei/doctrineextensions": "^1.3",
         "blackfire/php-sdk": "^1.23",
         "composer/package-versions-deprecated": "^1.11",

+ 7 - 33
config/services.yaml

@@ -1,31 +1,11 @@
+imports:
+    - { resource: services/* }
+
 # 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:
 
 services:
-    ########### Speeds up api-platform cache build substantially ###########
-    #### see https://github.com/api-platform/core/issues/4975  ####
-    api_platform.cache.metadata.property:
-        parent: cache.system
-        tags: [ cache.pool ]
-    api_platform.cache.metadata.resource:
-        parent: cache.system
-        tags: [ cache.pool ]
-    api_platform.cache.metadata.resource_collection:
-        parent: cache.system
-        tags: [ cache.pool ]
-    api_platform.cache.route_name_resolver:
-        parent: cache.system
-        tags: [ cache.pool ]
-    api_platform.cache.identifiers_extractor:
-        parent: cache.system
-        tags: [ cache.pool ]
-    api_platform.elasticsearch.cache.metadata.document:
-        parent: cache.system
-        tags: [ cache.pool ]
-
-    ########### End Speeds up api-platform cache build substantially ###########
-
     # default configuration for services in *this* file
     _defaults:
         autowire: true      # Automatically injects dependencies in your services.
@@ -39,13 +19,6 @@ services:
             $removeProcessor: '@api_platform.doctrine.orm.state.remove_processor'
             $opentalentNoReplyEmailAddress: 'noreply@opentalent.fr'
 
-    # Logging: a shorter version of the default monolog line formatter
-    monolog.formatter.message:
-        class: Monolog\Formatter\LineFormatter
-        arguments:
-            - "[%%datetime%%] %%level_name%% : %%message%%\n"
-            - "Y-m-d H:i:s.v"
-
     # 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\:
@@ -72,6 +45,10 @@ services:
 
     Gaufrette\Filesystem: '@knp_gaufrette.filesystem_map'
 
+    # To use the test fixtures
+    App\Tests\Fixture\:
+        resource: '%kernel.project_dir%/tests/Fixture/*'
+        
     #########################################
     ##  TAG Services ##
     _instanceof:
@@ -135,6 +112,3 @@ services:
     Symfony\Component\DependencyInjection\ContainerInterface: '@service_container'
     #########################################
 
-    # To use the test fixtures
-    App\Tests\Fixture\:
-        resource: '%kernel.project_dir%/tests/Fixture/*'

+ 21 - 0
config/services/api-platform.yaml

@@ -0,0 +1,21 @@
+services:
+    # Speeds up api-platform cache build substantially
+    # @see https://github.com/api-platform/core/issues/4975
+    api_platform.cache.metadata.property:
+      parent: cache.system
+      tags: [ cache.pool ]
+    api_platform.cache.metadata.resource:
+      parent: cache.system
+      tags: [ cache.pool ]
+    api_platform.cache.metadata.resource_collection:
+      parent: cache.system
+      tags: [ cache.pool ]
+    api_platform.cache.route_name_resolver:
+      parent: cache.system
+      tags: [ cache.pool ]
+    api_platform.cache.identifiers_extractor:
+      parent: cache.system
+      tags: [ cache.pool ]
+    api_platform.elasticsearch.cache.metadata.document:
+      parent: cache.system
+      tags: [ cache.pool ]

+ 7 - 0
config/services/monolog.yaml

@@ -0,0 +1,7 @@
+services:
+    # Logging: a shorter version of the default monolog line formatter
+    monolog.formatter.message:
+      class: Monolog\Formatter\LineFormatter
+      arguments:
+        - "[%%datetime%%] %%level_name%% : %%message%%\n"
+        - "Y-m-d H:i:s.v"