LegacyServiceFinder
class LegacyServiceFinder (View source)
Find drush.services.yml files.
This discovery class is used solely for backwards compatability with
Drupal modules that still use drush.services.ymls to define Drush
Commands, Alterers & etc.; this mechanism is deprecated, though.
Modules should instead use the static factory create
mechanism.
Properties
protected | $drushServiceYamls |
Methods
Get all service files that this class can discover.
Search for drush.service.yml files in discoverable locations.
Determine whether or not the Drush services.yml file is applicable for this version of Drush.
List of discovered drush.service.yml files
Gets one discovered drush.service.yml file
Get Drush services section from module's composer.json file
No description
Add a services.yml file if it exists.
Find Drupal modules
Details
__construct($moduleHandler, DrushConfig $drushConfig)
No description
array
getDrushServiceFiles()
Get all service files that this class can discover.
protected
discoverDrushServiceProviders()
Search for drush.service.yml files in discoverable locations.
protected
addModuleDrushServiceProvider(string $module, string $filename)
Determine whether or not the Drush services.yml file is applicable for this version of Drush.
protected string|null
findModuleDrushServiceProvider(string $module, string $dir)
List of discovered drush.service.yml files
protected
findDefaultServicesFile(string $module, string $dir)
Gets one discovered drush.service.yml file
protected array|false
findModuleDrushServiceProviderFromComposer(string $dir)
Get Drush services section from module's composer.json file
In composer.json, the Drush version constraints will appear in the 'extra' section like so:
"extra": { "drush": { "services": { "drush.services.yml": "^9" } } }
There may be multiple drush service files listed; the first one that has a version constraint that matches the Drush version is used.
protected string
findAppropriateServicesFile(string $module, array $services, string $dir)
No description
protected
addDrushServiceProvider(string $serviceProviderName, string $serviceYmlPath = '')
Add a services.yml file if it exists.
protected string[]
getModuleFileNames()
Find Drupal modules