32 $pending_upgrades = [];
37 foreach ($core_upgrades as
$class) {
44 $plugins = $this->plugins->find(
'active');
48 $batches = $plugin->getStaticConfig(
'upgrades');
50 if (empty($batches)) {
56 foreach ($batches as $class) {
64 return $pending_upgrades;
80 $upgrade_id =
"{$component_id}:{$version}";
95 $upgrade->title =
"{$component_id}:upgrade:{$version}:title";
96 $upgrade->description =
"{$component_id}:upgrade:{$version}:description";
117 if (!class_exists($class)) {
121 if (!is_subclass_of($class, Batch::class)) {
137 $upgrades = \Elgg\Database\Entities::find([
139 'subtype' =>
'elgg_upgrade',
140 'metadata_name_value_pairs' => [
143 'value' => (
string) $upgrade_id,
163 $upgrades = \Elgg\Database\Entities::find([
165 'subtype' =>
'elgg_upgrade',
166 'metadata_name_value_pairs' => [
169 'value' => $class_name,
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
static includeFile($file)
Include a file with as little context as possible.
static elgg()
Get the Elgg codebase path with "/".
Exception thrown if an argument is not of the expected type.
Locates and registers both core and plugin upgrades.
getBatch(string $class,\ElggUpgrade $upgrade=null)
Validates class and returns an instance of batch.
$plugin_id
Remove all user and plugin settings from the give plugin ID.
$upgrades
Lists pending upgrades.
const ELGG_IGNORE_ACCESS
elgg_call() flags
if(empty($guid)) $upgrade
Represents an upgrade that runs outside of the upgrade.php script.
getUpgradeByClass(string $class_name)
Check if there already is an ElggUpgrade for this upgrade class.
locate()
Looks for upgrades and saves them as ElggUpgrade entities.
getUpgrade($class, $component_id)
Gets intance of an ElggUpgrade based on the given class and id.
elgg_get_site_entity()
Get the current site entity.
__construct(protected Plugins $plugins)
Constructor.
upgradeExists($upgrade_id)
Check if there already is an ElggUpgrade for this upgrade.
Persistent, installation-wide key-value storage.