Skip to content

Commit

Permalink
Extension list (#4340)
Browse files Browse the repository at this point in the history
* Add new arguments key and target. Make it possible use not only default target for db connections

* Issue #4265: Replace DI with direct call of extension.list.module to avoid errors service is not found.
  • Loading branch information
LOBsTerr authored Sep 16, 2022
1 parent 28d741c commit b682f76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/Extension/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ class Manager
*/
private $extension = null;

/**
* @var Drupal\Core\Extension\ModuleExtensionList
*/
private $extensionList;

/**
* @var ModuleHandlerInterface
*/
Expand All @@ -67,22 +62,19 @@ class Manager
* @param Site $site
* @param Client $httpClient
* @param string $appRoot
* @param ModuleExtensionList $extensionList
* @param ModuleHandlerInterface $moduleHandler
* @param ThemeHandler $themeHandler
*/
public function __construct(
Site $site,
Client $httpClient,
$appRoot,
ModuleExtensionList $extensionList,
ModuleHandlerInterface $moduleHandler,
ThemeHandler $themeHandler
) {
$this->site = $site;
$this->httpClient = $httpClient;
$this->appRoot = $appRoot;
$this->extensionList = $extensionList;
$this->moduleHandler = $moduleHandler;
$this->themeHandler = $themeHandler;
$this->initialize();
Expand Down Expand Up @@ -250,7 +242,8 @@ private function discoverExtensions($type)
{
if ($type === 'module') {
$this->site->loadLegacyFile('/core/modules/system/system.module');
$this->extensionList->reset()->getList();
$extensionList = \Drupal::service('extension.list.module');
$extensionList->reset()->getList();
}

if ($type === 'theme') {
Expand Down
2 changes: 1 addition & 1 deletion uninstall.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
arguments: ['@app.root', '@console.configuration_manager']
console.extension_manager:
class: Drupal\Console\Extension\Manager
arguments: ['@console.site', '@http_client', '@app.root', '@extension.list.module', '@module_handler', '@theme_handler']
arguments: ['@console.site', '@http_client', '@app.root', '@module_handler', '@theme_handler']
# Commands
console.server:
class: Drupal\Console\Command\ServerCommand
Expand Down

0 comments on commit b682f76

Please sign in to comment.