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";
123 if (!class_exists($class)) {
127 if (!is_subclass_of($class, Batch::class)) {
143 $upgrades = \Elgg\Database\Entities::find([
145 'subtype' =>
'elgg_upgrade',
146 'metadata_name_value_pairs' => [
149 'value' => (
string) $upgrade_id,
169 $upgrades = \Elgg\Database\Entities::find([
171 'subtype' =>
'elgg_upgrade',
172 'metadata_name_value_pairs' => [
175 '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.
upgradeExists($upgrade_id)
Check if there already is an ElggUpgrade for this upgrade.
Persistent, installation-wide key-value storage.
__construct(Plugins $plugins)
Constructor.