Services - 9.5.x - drupal

Primary tabs

Introduction to services

A "service" (such as accessing the database, sending email, or translating user interface text) can be defined by a module or Drupal core. Defining a service means giving it a name and designating a default class to provide the service; ideally, there should also be an interface that defines the methods that may be called. Services are collected into the Dependency Injection Container, and can be overridden to use different classes or different instantiation by modules. See the Services and Dependency Injection Container topic for details.

Some services have tags, which are defined in the service definition. Tags are used to define a group of related services, or to specify some aspect of how the service behaves. See the Service Tags topic for more information.

See also

Services and Dependency Injection Container

Service Tags

File

core/core.api.php, line 905

Title File name Summary All service tags
serializer.normalizer.timestamp_item core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\TimestampItemNormalizer normalizer
serializer.normalizer.timestamp_item.hal core/modules/hal/hal.services.yml Drupal\hal\Normalizer\TimestampItemNormalizer normalizer
serializer.normalizer.traversable_object.jsonapi_test_data_type core/modules/jsonapi/tests/modules/jsonapi_test_data_type/jsonapi_test_data_type.services.yml Drupal\jsonapi_test_data_type\Normalizer\TraversableObjectNormalizer normalizer
serializer.normalizer.typed_data core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\TypedDataNormalizer normalizer
serializer.normalizer.unprocessable_entity_exception.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\UnprocessableHttpEntityExceptionNormalizer jsonapi_normalizer
services_default_test.no_autowire core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml Drupal\services_defaults_test\TestService
services_default_test.no_autowire.arg core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml Drupal\services_defaults_test\TestInjection
service_provider_test_class core/modules/system/tests/modules/service_provider_test/service_provider_test.services.yml Drupal\service_provider_test\TestClass event_subscriber, needs_destruction
session core/core.services.yml Symfony\Component\HttpFoundation\Session\Session service_collector
session.attribute_bag core/core.services.yml Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag
session.flash_bag core/core.services.yml Symfony\Component\HttpFoundation\Session\Flash\FlashBag
session_configuration core/core.services.yml Drupal\Core\Session\SessionConfiguration
session_handler core/core.services.yml Alias of session_handler.storage
session_handler.storage core/core.services.yml Drupal\Core\Session\SessionHandler backend_overridable
session_handler.write_safe core/core.services.yml Drupal\Core\Session\WriteSafeSessionHandler session_handler_proxy
session_manager core/core.services.yml Drupal\Core\Session\SessionManager backend_overridable
session_manager.metadata_bag core/core.services.yml Drupal\Core\Session\MetadataBag
session_test.session_bag core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\Session\TestSessionBag session_bag
session_test.session_handler.test_proxy core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\Session\TestSessionHandlerProxy session_handler_proxy
session_test.session_handler.test_proxy2 core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\Session\TestSessionHandlerProxy session_handler_proxy
session_test.session_handler_proxy_trace core/modules/system/tests/modules/session_test/session_test.services.yml ArrayObject
session_test.subscriber core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\EventSubscriber\SessionTestSubscriber event_subscriber
settings core/core.services.yml Drupal\Core\Site\Settings
settings_tray_override_test.overrider core/modules/settings_tray/tests/modules/settings_tray_override_test/settings_tray_override_test.services.yml Drupal\settings_tray_override_test\ConfigOverrider config.factory.override
shortcut.lazy_builders core/modules/shortcut/shortcut.services.yml Drupal\shortcut\ShortcutLazyBuilders
site.path core/core.services.yml \SplString parameter_service
site.path.factory core/core.services.yml Drupal\Core\SitePathFactory
sqlite.views.date_sql core/modules/views/views.services.yml Drupal\views\Plugin\views\query\SqliteDateSql
state core/core.services.yml Drupal\Core\State\State
statistics.storage.node core/modules/statistics/statistics.services.yml Drupal\statistics\NodeStatisticsDatabaseStorage backend_overridable
stream_wrapper.dummy core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyStreamWrapper stream_wrapper
stream_wrapper.dummy_external_readonly core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyExternalReadOnlyWrapper stream_wrapper
stream_wrapper.dummy_readonly core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyReadOnlyStreamWrapper stream_wrapper
stream_wrapper.dummy_remote core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyRemoteStreamWrapper stream_wrapper
stream_wrapper.public core/core.services.yml Drupal\Core\StreamWrapper\PublicStream stream_wrapper
stream_wrapper.temporary core/core.services.yml Drupal\Core\StreamWrapper\TemporaryStream stream_wrapper
stream_wrapper.translations core/modules/locale/locale.services.yml Drupal\locale\StreamWrapper\TranslationsStream stream_wrapper
stream_wrapper_manager core/core.services.yml Drupal\Core\StreamWrapper\StreamWrapperManager
string_translation core/core.services.yml Drupal\Core\StringTranslation\TranslationManager service_collector
string_translator.custom_strings core/core.services.yml Drupal\Core\StringTranslation\Translator\CustomStrings string_translator
string_translator.locale.lookup core/modules/locale/locale.services.yml Drupal\locale\LocaleTranslation string_translator, needs_destruction
system.admin_path.route_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AdminRouteSubscriber event_subscriber
system.advisories_config_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AdvisoriesConfigSubscriber event_subscriber
system.breadcrumb.default core/modules/system/system.services.yml Drupal\system\PathBasedBreadcrumbBuilder breadcrumb_builder
system.config_cache_tag core/modules/system/system.services.yml Drupal\system\EventSubscriber\ConfigCacheTag event_subscriber
system.config_subscriber core/modules/system/system.services.yml Drupal\system\SystemConfigSubscriber event_subscriber
system.file_event.subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\SecurityFileUploadEventSubscriber event_subscriber
system.manager core/modules/system/system.services.yml Drupal\system\SystemManager
system.sa_fetcher core/modules/system/system.services.yml Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher
system.timezone_resolver core/modules/system/system.services.yml Drupal\system\TimeZoneResolver event_subscriber

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.