You are here

libraries.services.yml in Libraries API 8.3

File

libraries.services.yml
View source
  1. services:
  2. libraries.manager:
  3. class: Drupal\libraries\ExternalLibrary\LibraryManager
  4. arguments:
  5. - '@libraries.definition.discovery'
  6. - '@plugin.manager.libraries.library_type'
  7. # By default Libraries API downloads library definitions from a number of
  8. # remote library registries, the canonical one being
  9. # https://www.drupal.org/project/libraries_registry, and stores them locally
  10. # in the public://library-definitions directory. The URLs of the remote
  11. # library registries and the local base path can be configured. The remote
  12. # fetching can also be disabled altogether.
  13. libraries.definition.discovery:
  14. class: Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface
  15. factory: 'libraries.definition.discovery.factory:get'
  16. libraries.definition.discovery.factory:
  17. class: Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryFactory
  18. arguments:
  19. - '@config.factory'
  20. - '@serialization.json'
  21. - '@http_client'
  22. - '@serialization.json'
  23. # If you instead want to check your library definitions into version control
  24. # and use YAML for them instead of JSON, you can place the following service
  25. # definition in your site's services.yml file:
  26. # libraries.definition.discovery:
  27. # class: Drupal\libraries\ExternalLibrary\Definition\FileDefinitionDiscovery
  28. # arguments:
  29. # - '@serialization.yaml'
  30. # # Replace this with the location of the library definitions in your setup.
  31. # - '../library-definitions'
  32. plugin.manager.libraries.library_type:
  33. class: Drupal\libraries\ExternalLibrary\Type\LibraryTypeFactory
  34. parent: default_plugin_manager
  35. plugin.manager.libraries.locator:
  36. class: Drupal\libraries\ExternalLibrary\Local\LocatorManager
  37. parent: default_plugin_manager
  38. plugin.manager.libraries.version_detector:
  39. class: Drupal\libraries\ExternalLibrary\Version\VersionDetectorManager
  40. parent: default_plugin_manager
  41. libraries.config_subscriber:
  42. class: Drupal\libraries\Config\LibrariesConfigSubscriber
  43. arguments: ['@service_container']
  44. tags:
  45. - { name: event_subscriber }
  46. libraries.php_file_loader:
  47. class: Drupal\libraries\ExternalLibrary\PhpFile\PhpRequireLoader
  48. stream_wrapper.library_definitions:
  49. class: Drupal\libraries\StreamWrapper\LibraryDefinitionsStream
  50. arguments: ['@config.factory']
  51. tags:
  52. - { name: stream_wrapper, scheme: 'library-definitions' }
  53. stream_wrapper.asset_libraries:
  54. class: Drupal\libraries\StreamWrapper\AssetLibrariesStream
  55. tags:
  56. - { name: stream_wrapper, scheme: 'asset' }
  57. stream_wrapper.php_file_libraries:
  58. class: Drupal\libraries\StreamWrapper\PhpFileLibrariesStream
  59. tags:
  60. - { name: stream_wrapper, scheme: 'php-file' }
  61. cache.libraries:
  62. class: Drupal\Core\Cache\CacheBackendInterface
  63. tags:
  64. - { name: cache.bin }
  65. factory: cache_factory:get
  66. arguments: [library]