$regexp = '/^(?<extension>.+)_' .
$this->updateType . '_(?<name>.+)$/';
$functions =
get_defined_functions();
$updates =
[];
foreach (preg_grep('/_' .
$this->updateType . '_/',
$functions['user'
]) as $function) { // If this function is an extension update function, add it to the list of
// extension updates.
if (preg_match($regexp,
$function,
$matches)) { if (in_array($matches['extension'
],
$this->enabledExtensions
)) { $function_name =
$matches['extension'
] . '_' .
$this->updateType . '_' .
$matches['name'
];
if ($this->updateType === 'post_update'
) { $removed =
array_keys($this->
getRemovedPostUpdates($matches['extension'
]));
if (array_search($function_name,
$removed) !== FALSE
) { throw new RemovedPostUpdateNameException(sprintf('The following update is specified as removed in hook_removed_post_updates() but still exists in the code base: %s',
$function_name));
} } $updates[] =
$function_name;
} } } // Ensure that the update order is deterministic.
sort($updates);
return $updates;
}