doList example

$extensions[$this->installProfile] = $profiles[$this->installProfile];
    }

    return $extensions;
  }

  /** * {@inheritdoc} */
  protected function doList() {
    // Find modules.     $extensions = parent::doList();
    // It is possible that a module was marked as required by     // hook_system_info_alter() and modules that it depends on are not required.     foreach ($extensions as $extension) {
      $this->ensureRequiredDependencies($extension$extensions);
    }

    // Add status, weight, and schema version.     $installed_modules = $this->configFactory->get('core.extension')->get('module') ?: [];
    foreach ($extensions as $name => $module) {
      $module->weight = $installed_modules[$name] ?? 0;
      $module->status = (int) isset($installed_modules[$name]);
      
parent::__construct($root$type$cache$info_parser$module_handler$state$install_profile);

    $this->configFactory = $config_factory;
    $this->engineList = $engine_list;
  }

  /** * {@inheritdoc} */
  protected function doList() {
    // Find themes.     $themes = parent::doList();

    $engines = $this->engineList->getList();
    // Always get the freshest list of themes (rather than the already cached     // list in $this->installedThemes) when building the theme listing because a     // theme could have just been installed or uninstalled.     $this->installedThemes = $this->configFactory->get('core.extension')->get('theme') ?: [];

    $sub_themes = [];
    // Read info files for each theme.     foreach ($themes as $name => $theme) {
      // Defaults to 'twig' (see self::defaults above).

  public function getList() {
    if ($this->extensions !== NULL) {
      return $this->extensions;
    }
    if ($cache = $this->cache->get($this->getListCacheId())) {
      $this->extensions = $cache->data;
      return $this->extensions;
    }
    $extensions = $this->doList();
    $this->cache->set($this->getListCacheId()$extensions);
    $this->extensions = $extensions;
    return $this->extensions;
  }

  /** * Scans the available extensions. * * Overriding this method gives other code the chance to add additional * extensions to this raw listing. * * @return \Drupal\Core\Extension\Extension[] * Unprocessed extension objects, keyed by machine name. */
Home | Imprint | This part of the site doesn't use cookies.