class BackendCompilerPass

Defines a compiler pass to allow automatic override per backend.

A module developer has to tag his backend service with "backend_overridable":

custom_service:
  class: ...
  tags:
    - { name: backend_overridable }

As a site admin you set the 'default_backend' in your services.yml file:

parameters:
  default_backend: sqlite

As a developer for alternative storage engines you register a service with $yourbackend.$original_service:

sqlite.custom_service:
  class: ...

Hierarchy

File

core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php, line 34

Namespace

Drupal\Core\DependencyInjection\Compiler

Members

Name Modifiers Type Description
BackendCompilerPass::process public function You can modify the container here before it is dumped to PHP code. Overrides CompilerPassInterface::process

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!DependencyInjection!Compiler!BackendCompilerPass.php/class/BackendCompilerPass/8.1.x