Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Service manager provides an UI to see list of available services in Drupal 8. It also provides list of alternative definition available for a particular services by checking the interface implemented by a service.

Why Service Manager?

  1. No way to see all the services in one place
  2. No way to know the available alternative implementation for a service
  3. No easy way to switch the service class without updating sites/default/services.yml
  4. Every override need to updated in sites/default/services.yml

How service manager solves the above problem

  1. UI to see all the services available
  2. Shows list of alternative implementations (not accurate as try to find classes implement the same interface)
  3. Not in place - But can add a option to switch class. This can be done
  4. Not in place - If we can import the services using yml file as mentioned in Symfony documention, we can generate the service file dynamically and all we need in sites/default/services.yml is just this:
    
    # sites/default/services.yml
    imports:
        - { resource: "@Drupal/serivice_manager/Resources/config/services.yml" }
    

Obviously, we can add plugin/hook to modules to provide mandatory overrides.

Project information

  • Created by vijaycs85 on , updated