InstallerModuleExtensionList
class InstallerModuleExtensionList extends ModuleExtensionList (View source)
Overrides the module extension list to have a static cache.
Traits
Provides common functionality for the extension list classes.
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Properties
| protected string | $type | The type of the extension: "module", "theme" or "profile". |
from ExtensionList |
| protected string | $root | The app root. |
from ExtensionList |
| protected CacheBackendInterface | $cache | The cache. |
from ExtensionList |
| protected | $defaults | {@inheritdoc} | from ModuleExtensionList |
| protected InfoParserInterface | $infoParser | The info parser. |
from ExtensionList |
| protected ModuleHandlerInterface | $moduleHandler | The module handler. |
from ExtensionList |
| protected Extension[]|null | $extensions | The cached extensions. |
from ExtensionList |
| protected array[]|null | $extensionInfo | Static caching for extension info. |
from ExtensionList |
| protected string[]|null | $pathNames | A list of extension folder names keyed by extension name. |
from ExtensionList |
| protected string[] internal | $addedPathNames | A list of extension folder names directly added in code (not discovered). |
from ExtensionList |
| protected StateInterface | $state | The state store. |
from ExtensionList |
| protected string | $installProfile | The install profile used by the site. |
from ExtensionList |
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected ConfigFactoryInterface | $configFactory | The config factory. |
from ModuleExtensionList |
| protected ExtensionList | $profileList | The profile list needed by this module list. |
from ModuleExtensionList |
| static protected string[] internal | $staticAddedPathNames | Static version of the added file names during the installer. |
from ExtensionListTrait |
Methods
Constructs a new ModuleExtensionList instance.
Returns the extension discovery.
Determines if an extension exists in the filesystem.
Returns the human-readable name of the extension.
Returns information about a specified extension.
Returns an array of info files information of available extensions.
Returns a list of machine names of installed extensions.
Returns an array of info files information of installed extensions.
Generates the information from .info.yml files for extensions of this type.
Returns a list of extension file paths keyed by machine name.
Generates a sorted list of .info.yml file locations for all extensions.
Gets the path to an extension of a specific type (module, theme, etc.).
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Gets the processed active profile object, or null.
Marks dependencies of required modules as 'required', recursively.
Details
__construct(string $root, string $type, CacheBackendInterface $cache, InfoParserInterface $info_parser, ModuleHandlerInterface $module_handler, StateInterface $state, ConfigFactoryInterface $config_factory, ExtensionList $profile_list, string $install_profile, array $container_modules_info = [])
Constructs a new ModuleExtensionList instance.
protected ExtensionDiscovery
getExtensionDiscovery()
Returns the extension discovery.
$this
reset()
Resets the stored extension list.
We don't reset statically added filenames, as it is a static cache which logically can't change. This is done for performance reasons of the installer.
protected string
getListCacheId()
Returns the extension list cache ID.
protected string
getInfoCacheId()
Returns the extension info cache ID.
protected string
getPathnamesCacheId()
Returns the extension filenames cache ID.
bool
exists(string $extension_name)
Determines if an extension exists in the filesystem.
string
getName(string $extension_name)
Returns the human-readable name of the extension.
Extension
get(string $extension_name)
Returns a single extension.
Extension[]
getList()
Returns all available extensions.
protected Extension[]
doScanExtensions()
Scans the available extensions.
Overriding this method gives other code the chance to add additional extensions to this raw listing.
protected Extension[]
doList()
Builds the list of extensions.
array
getExtensionInfo(string $extension_name)
Returns information about a specified extension.
This function returns the contents of the .info.yml file for the specified extension.
array[]
getAllAvailableInfo()
Returns an array of info files information of available extensions.
This function returns the processed contents (with added defaults) of the .info.yml files.
protected string[]
getInstalledExtensionNames()
Returns a list of machine names of installed extensions.
array[]
getAllInstalledInfo()
Returns an array of info files information of installed extensions.
This function returns the processed contents (with added defaults) of the .info.yml files.
protected array[]
recalculateInfo()
Generates the information from .info.yml files for extensions of this type.
string[]
getPathnames()
Returns a list of extension file paths keyed by machine name.
protected string[]
recalculatePathnames()
Generates a sorted list of .info.yml file locations for all extensions.
setPathname($extension_name, $pathname)
No description
getPathname($extension_name)
No description
string
getPath(string $extension_name)
Gets the path to an extension of a specific type (module, theme, etc.).
The path is the directory in which the .info file is located. This name is coming from \SplFileInfo.
protected array
createExtensionInfo(Extension $extension)
Creates the info value for an extension object.
bool
checkIncompatibility(string $name)
Tests the compatibility of an extension.
static int
sortByName(Extension $a, Extension $b)
Array sorting callback; sorts extensions by their name.
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
protected string[]
getProfileDirectories(ExtensionDiscovery $discovery)
Finds all installation profile paths.
protected Extension|null
getActiveProfile()
Gets the processed active profile object, or null.
protected
ensureRequiredDependencies(Extension $module, array $modules = [])
Marks dependencies of required modules as 'required', recursively.