webprofiler.services.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. parameters:
  2. webprofiler.only_exceptions: false
  3. webprofiler.only_master_requests: false
  4. services:
  5. # profiler services
  6. logger.channel.webprofiler:
  7. class: Drupal\Core\Logger\LoggerChannel
  8. factory: logger.factory:get
  9. arguments: ['webprofiler']
  10. profiler.file_storage:
  11. class: Drupal\webprofiler\Profiler\FileProfilerStorage
  12. arguments: ['%data_collector.storage%']
  13. tags:
  14. - { name: webprofiler_storage, title: 'File storage' }
  15. profiler.database_storage:
  16. class: Drupal\webprofiler\Profiler\DatabaseProfilerStorage
  17. arguments: ['@database']
  18. tags:
  19. - { name: webprofiler_storage, title: 'Database storage' }
  20. profiler.storage_manager:
  21. class: Drupal\webprofiler\Profiler\ProfilerStorageManager
  22. profiler.storage:
  23. class: Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
  24. factory: Drupal\webprofiler\Profiler\ProfilerStorageFactory::getProfilerStorage
  25. arguments: ['@config.factory', '@service_container']
  26. profiler:
  27. class: Drupal\webprofiler\Profiler\Profiler
  28. arguments: ['@profiler.storage', '@logger.channel.webprofiler', '@config.factory']
  29. # template manager
  30. template_manager:
  31. class: Drupal\webprofiler\Profiler\TemplateManager
  32. arguments: ['@profiler', '@twig', '@twig.loader', '%data_collector.templates%']
  33. # request matcher
  34. webprofiler.matcher:
  35. class: Drupal\webprofiler\RequestMatcher\WebprofilerRequestMatcher
  36. arguments: ['@config.factory', '@path.matcher']
  37. # event subscribers
  38. webprofiler.profiler_listener:
  39. class: Symfony\Component\HttpKernel\EventListener\ProfilerListener
  40. arguments: ['@profiler', '@request_stack', '@?webprofiler.matcher', '%webprofiler.only_exceptions%', '%webprofiler.only_master_requests%']
  41. tags:
  42. - { name: event_subscriber }
  43. webprofiler.webprofiler_event_subscriber:
  44. class: Drupal\webprofiler\EventSubscriber\WebprofilerEventSubscriber
  45. arguments: ['@current_user', '@url_generator', '@renderer']
  46. tags:
  47. - { name: event_subscriber }
  48. # twig profiler
  49. twig.profile:
  50. class: Twig_Profiler_Profile
  51. twig.extension.profiler:
  52. class: Drupal\webprofiler\Twig\Extension\ProfilerExtension
  53. arguments: ['@twig.profile', '@stopwatch', '@webprofiler.ide_link_generator', '@webprofiler.class_shortener']
  54. tags:
  55. - { name: twig.extension, priority: 100 }
  56. # datacollector services
  57. webprofiler.drupal:
  58. class: Drupal\webprofiler\DataCollector\DrupalDataCollector
  59. arguments: ['@redirect.destination', '@url_generator']
  60. tags:
  61. - { name: data_collector, template: '@webprofiler/Collector/drupal.html.twig', id: 'drupal', title: 'Drupal', priority: 10 }
  62. webprofiler.devel:
  63. class: Drupal\webprofiler\DataCollector\DevelDataCollector
  64. arguments: ['@menu.link_tree']
  65. tags:
  66. - { name: data_collector, template: '@webprofiler/Collector/devel.html.twig', id: 'devel', title: 'Devel', priority: 15 }
  67. webprofiler.php_config:
  68. class: Drupal\webprofiler\DataCollector\PhpConfigDataCollector
  69. tags:
  70. - { name: data_collector, template: '@webprofiler/Collector/php_config.html.twig', id: 'php_config', title: 'PHP Config', priority: 20 }
  71. webprofiler.request:
  72. class: Drupal\webprofiler\DataCollector\RequestDataCollector
  73. arguments: ['@controller_resolver']
  74. tags:
  75. - { name: data_collector, template: '@webprofiler/Collector/request.html.twig', id: 'request', title: 'Request', priority: 30 }
  76. - { name: event_subscriber }
  77. webprofiler.time:
  78. class: Drupal\webprofiler\DataCollector\TimeDataCollector
  79. arguments: [NULL, '@stopwatch']
  80. tags:
  81. - { name: data_collector, template: '@webprofiler/Collector/time.html.twig', id: 'time', title: 'Timeline', priority: 40 }
  82. webprofiler.performance_timing:
  83. class: Drupal\webprofiler\DataCollector\PerformanceTimingDataCollector
  84. tags:
  85. - { name: data_collector, template: '@webprofiler/Collector/performance_timing.html.twig', id: 'performance_timing', title: 'Performance Timing', priority: 50 }
  86. webprofiler.database:
  87. class: Drupal\webprofiler\DataCollector\DatabaseDataCollector
  88. arguments: ['@database', '@config.factory']
  89. tags:
  90. - { name: data_collector, template: '@webprofiler/Collector/database.html.twig', id: 'database', title: 'Database', priority: 60 }
  91. webprofiler.user:
  92. class: Drupal\webprofiler\DataCollector\UserDataCollector
  93. arguments: ['@current_user', '@entity.manager', '@config.factory', '@authentication_collector']
  94. tags:
  95. - { name: data_collector, template: '@webprofiler/Collector/user.html.twig', id: 'user', title: 'User', priority: 70 }
  96. webprofiler.forms:
  97. class: Drupal\webprofiler\DataCollector\FormsDataCollector
  98. arguments: ['@form_builder']
  99. tags:
  100. - { name: data_collector, template: '@webprofiler/Collector/forms.html.twig', id: 'forms', title: 'Forms', priority: 80 }
  101. webprofiler.drupal_extensions:
  102. class: Drupal\webprofiler\DataCollector\ExtensionDataCollector
  103. arguments: ['@module_handler', '@theme_handler', '@app.root']
  104. tags:
  105. - { name: data_collector, template: '@webprofiler/Collector/extensions.html.twig', id: 'drupal_extension', title: 'Extensions', priority: 90 }
  106. webprofiler.routing:
  107. class: Drupal\webprofiler\DataCollector\RoutingDataCollector
  108. arguments: ['@router.route_provider']
  109. tags:
  110. - { name: data_collector, template: '@webprofiler/Collector/routing.html.twig', id: 'routing', title: 'Routing', priority: 100 }
  111. webprofiler.cache:
  112. class: Drupal\webprofiler\DataCollector\CacheDataCollector
  113. tags:
  114. - { name: data_collector, template: '@webprofiler/Collector/cache.html.twig', id: 'cache', title: 'Cache', priority: 110 }
  115. webprofiler.assets:
  116. class: Drupal\webprofiler\DataCollector\AssetsDataCollector
  117. arguments: ['@app.root']
  118. tags:
  119. - { name: data_collector, template: '@webprofiler/Collector/assets.html.twig', id: 'assets', title: 'Assets', priority: 120}
  120. webprofiler.config:
  121. class: Drupal\webprofiler\DataCollector\ConfigDataCollector
  122. tags:
  123. - { name: data_collector, template: '@webprofiler/Collector/config.html.twig', id: 'config', title: 'Config', priority: 130 }
  124. webprofiler.state:
  125. class: Drupal\webprofiler\DataCollector\StateDataCollector
  126. tags:
  127. - { name: data_collector, template: '@webprofiler/Collector/state.html.twig', id: 'state', title: 'State', priority: 140 }
  128. webprofiler.events:
  129. class: Drupal\webprofiler\DataCollector\EventsDataCollector
  130. arguments: ['@event_dispatcher']
  131. tags:
  132. - { name: data_collector, template: '@webprofiler/Collector/events.html.twig', id: 'events', title: 'Events', priority: 150 }
  133. webprofiler.services:
  134. class: Drupal\webprofiler\DataCollector\ServicesDataCollector
  135. arguments: ['@service_container']
  136. tags:
  137. - { name: data_collector, template: '@webprofiler/Collector/services.html.twig', id: 'services', title: 'Services', priority: 160 }
  138. webprofiler.http:
  139. class: Drupal\webprofiler\DataCollector\HttpDataCollector
  140. arguments: ['@http_client_middleware.webprofiler']
  141. tags:
  142. - { name: data_collector, template: '@webprofiler/Collector/http.html.twig', id: 'http', title: 'Http', priority: 170 }
  143. webprofiler.theme:
  144. class: Drupal\webprofiler\DataCollector\ThemeDataCollector
  145. arguments: ['@theme.manager', '@theme.negotiator', '@twig.profile']
  146. tags:
  147. - { name: data_collector, template: '@webprofiler/Collector/theme.html.twig', id: 'theme', title: 'Theme', priority: 180 }
  148. webprofiler.mail:
  149. class: Drupal\webprofiler\DataCollector\MailDataCollector
  150. tags:
  151. - { name: data_collector, template: '@webprofiler/Collector/mail.html.twig', id: 'mail', title: 'Mail', priority: 190 }
  152. # debug services
  153. stopwatch:
  154. class: Drupal\webprofiler\Stopwatch
  155. webprofiler.debug.plugin.manager.mail.default:
  156. class: Drupal\Core\Mail\MailManager
  157. arguments: ['@container.namespaces', '@cache.discovery', '@module_handler', '@config.factory', '@logger.factory', '@string_translation', '@renderer']
  158. webprofiler.debug.controller_resolver:
  159. class: Symfony\Component\HttpKernel\Controller\TraceableControllerResolver
  160. arguments: ['@controller_resolver', '@stopwatch']
  161. webprofiler.debug.cache_factory:
  162. class: Drupal\webprofiler\Cache\CacheFactoryWrapper
  163. public: false
  164. decorates: cache_factory
  165. arguments: ['@webprofiler.debug.cache_factory.inner', '@webprofiler.cache']
  166. properties:
  167. _serviceId: 'cache_factory'
  168. webprofiler.debug.asset.css.collection_renderer:
  169. class: Drupal\webprofiler\Asset\CssCollectionRendererWrapper
  170. public: false
  171. decorates: asset.css.collection_renderer
  172. arguments: ['@webprofiler.debug.asset.css.collection_renderer.inner', '@webprofiler.assets']
  173. properties:
  174. _serviceId: 'asset.css.collection_renderer'
  175. webprofiler.debug.asset.js.collection_renderer:
  176. class: Drupal\webprofiler\Asset\JsCollectionRendererWrapper
  177. public: false
  178. decorates: asset.js.collection_renderer
  179. arguments: ['@webprofiler.debug.asset.js.collection_renderer.inner', '@webprofiler.assets']
  180. properties:
  181. _serviceId: 'asset.js.collection_renderer'
  182. webprofiler.debug.entity_type.manager:
  183. class: Drupal\webprofiler\Entity\EntityManagerWrapper
  184. public: false
  185. decorates: entity_type.manager
  186. arguments: ['@webprofiler.debug.entity_type.manager.inner']
  187. properties:
  188. _serviceId: 'entity_type.manager'
  189. webprofiler.debug.state:
  190. class: Drupal\webprofiler\State\StateWrapper
  191. public: false
  192. decorates: state
  193. arguments: ['@webprofiler.debug.state.inner', '@webprofiler.state']
  194. properties:
  195. _serviceId: 'state'
  196. # middleware
  197. http_middleware.webprofiler:
  198. class: Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware
  199. tags:
  200. - { name: http_middleware, priority: 350 }
  201. http_client_middleware.webprofiler:
  202. class: Drupal\webprofiler\Http\HttpClientMiddleware
  203. tags:
  204. - { name: http_client_middleware }
  205. # parameter converter service for profile token
  206. webprofiler.token_converter:
  207. class: Drupal\webprofiler\Routing\TokenConverter
  208. tags:
  209. - { name: paramconverter }
  210. # IDE link generator service
  211. webprofiler.ide_link_generator:
  212. class: Drupal\webprofiler\Helper\IdeLinkGenerator
  213. arguments: ['@config.factory']
  214. # class shortener service
  215. webprofiler.class_shortener:
  216. class: Drupal\webprofiler\Helper\ClassShortener