createExtensionInfo example

$used_themes[$base_key] = TRUE;
      return $this->doGetBaseThemes($themes$base_key$used_themes) + $current_base_theme;
    }
    // If we get here, then this is our parent theme.     return $current_base_theme;
  }

  /** * {@inheritdoc} */
  protected function createExtensionInfo(Extension $extension) {
    $info = parent::createExtensionInfo($extension);

    if (!isset($info['base theme'])) {
      throw new InfoParserException(sprintf('Missing required key ("base theme") in %s, see https://www.drupal.org/node/3066038', $extension->getPathname()));
    }

    // Remove the base theme when 'base theme: false' is set in a theme     // .info.yml file.     if ($info['base theme'] === FALSE) {
      unset($info['base theme']);
    }

    

  protected function doList() {
    // Find extensions.     $extensions = $this->doScanExtensions();

    // Read info files for each extension.     foreach ($extensions as $extension) {
      $extension->info = $this->createExtensionInfo($extension);

      // Invoke hook_system_info_alter() to give installed modules a chance to       // modify the data in the .info.yml files if necessary.       $this->moduleHandler->alter('system_info', $extension->info, $extension$this->type);
    }

    return $extensions;
  }

  /** * Returns information about a specified extension. * * This function returns the contents of the .info.yml file for the specified * extension. * * @param string $extension_name * The name of an extension whose information shall be returned. * * @return mixed[] * An associative array of extension information. * * @throws \Drupal\Core\Extension\Exception\UnknownExtensionException * If there is no extension with the supplied name. */
Home | Imprint | This part of the site doesn't use cookies.