UpdateRegistry
class UpdateRegistry (View source)
Provides all and missing update implementations.
Note: This registry is specific to a type of updates, like 'post_update' as example.
It therefore scans for functions named like the type of updates, so it looks like MODULE_UPDATETYPE_NAME() with NAME being a machine name.
Properties
| protected string | $updateType | The used update name. |
|
| protected string | $root | The app root. |
|
| protected string | $logFilename | The filename of the log file. |
|
| protected string[] | $enabledModules | ||
| protected KeyValueStoreInterface | $keyValue | The key value storage. |
|
| protected bool|null | $includeTests | Should we respect update functions in tests. |
|
| protected string | $sitePath | The site path. |
Methods
Constructs a new UpdateRegistry.
Gets removed hook_post_update_NAME() implementations for a module.
Gets all available update functions.
Find all update functions that haven't been executed.
Loads all update files for a given list of extension.
Returns a list of all the pending updates.
Registers that update functions were executed.
Returns all available updates for a given module.
Scans all module + profile extensions and load the update files.
Filters out already executed update functions by module.
Details
__construct(string $root, string $site_path, array $enabled_modules, KeyValueStoreInterface $key_value, bool|null $include_tests = NULL)
Constructs a new UpdateRegistry.
string[]
getRemovedPostUpdates($module)
Gets removed hook_post_update_NAME() implementations for a module.
protected callable[]
getAvailableUpdateFunctions()
Gets all available update functions.
callable[]
getPendingUpdateFunctions()
Find all update functions that haven't been executed.
protected
loadUpdateFiles(array $module_extensions)
Loads all update files for a given list of extension.
protected
loadUpdateFile(Extension $module)
Loads the {$this->updateType}.php file for a given extension.
array[]
getPendingUpdateInformation()
Returns a list of all the pending updates.
$this
registerInvokedUpdates(array $function_names)
Registers that update functions were executed.
callable[]
getModuleUpdateFunctions(string $module_name)
Returns all available updates for a given module.
protected
scanExtensionsAndLoadUpdateFiles()
Scans all module + profile extensions and load the update files.
filterOutInvokedUpdatesByModule(string $module)
Filters out already executed update functions by module.