TYPO3 Logo
TYPO3 CMS Services
Release: 8.7

Loading data.

  • Introduction
  • Using services
    • Service precedence
    • Simple use
    • Use with subtypes
    • Calling a chain of services
  • Configuration
    • Registration changes
    • Service configuration
    • Service type configuration
  • Developer’s Guide
    • Introducing a new service type
    • Implementing a service
    • Service API
    • Service-related API
  • Authentication services
  • Sitemap
  • Index

PAGE CONTENTS

  • Service-related API
    • \TYPO3\CMS\Core\Utility\ExtensionManagementUtility
    • \TYPO3\CMS\Core\Utility\GeneralUtility
  1. Start
  2. Developer’s Guide
  3. Service-related API
View source How to edit Edit on GitHub

Service-related API¶

This section describes the methods of the TYPO3 CMS core that are related to the use of services.

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility¶

This extension management class contains three methods related to services:

addService
This method is used to register services with TYPO3 CMS. It checks for availability of a service with regards to OS dependency (if any) and fills the $GLOBALS['T3_SERVICES'] array, where information about all registered services is kept.
findService

This method is used to find the appropriate service given a type and a subtype. It handles priority and quality rankings. It also checks for availability based on executables dependencies, if any.

This method is normally called by \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceService(), so you shouldn’t have to worry about calling it directly, but it can be useful to check if there’s at least one service available.

deactivateService
Marks a service as unavailable. It is called internally by addService() and findService() and should probably not be called directly unless you’re sure of what you’re doing.

\TYPO3\CMS\Core\Utility\GeneralUtility¶

This class contains a single method related to services, but the most useful one, used to get an instance of a service.

makeInstanceService

This method is used to get an instance of a service class of a given type and subtype. It calls on \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::findService() to find the best possible service (in terms of priority and quality).

As described above it keeps a registry of all instantiated service classes and uses existing instances whenever possible, in effect turning service classes into singletons.

  • Previous
  • Next
  • Home
  • Contact
  • Issues
  • Repository

Last updated: Mar 29, 2022 14:45

Last rendered: Mar 29, 2022 14:46

TYPO3 Theme 4.6.2

© Copyright since 2012 by the TYPO3 contributors
  • Legal Notice
  • Privacy Policy