29 $this->plugins = $plugins;
38 $pending_upgrades = [];
43 foreach ($core_upgrades as
$class) {
50 $plugins = $this->plugins->find(
'active');
54 $batches = $plugin->getStaticConfig(
'upgrades');
56 if (empty($batches)) {
62 foreach ($batches as $class) {
70 return $pending_upgrades;
86 $upgrade_id =
"{$component_id}:{$version}";
101 $upgrade->title =
"{$component_id}:upgrade:{$version}:title";
102 $upgrade->description =
"{$component_id}:upgrade:{$version}:description";
122 if (!class_exists(
$class)) {
126 if (!is_subclass_of(
$class, Batch::class)) {
142 $upgrades = \Elgg\Database\Entities::find([
144 'subtype' =>
'elgg_upgrade',
145 'private_setting_name_value_pairs' => [
148 'value' => (
string) $upgrade_id,
168 $upgrades = \Elgg\Database\Entities::find([
170 'subtype' =>
'elgg_upgrade',
171 'private_setting_name_value_pairs' => [
174 '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.
$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
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.
upgradeExists($upgrade_id)
Check if there already is an ElggUpgrade for this upgrade.
Persistent, installation-wide key-value storage.
getBatch($class)
Validates class and returns an instance of batch.
__construct(Plugins $plugins)
Constructor.