41 $this->plugins = $plugins;
42 $this->logger = $logger;
51 $pending_upgrades = [];
56 foreach ($core_upgrades as
$class) {
63 $plugins = $this->plugins->find(
'active');
67 $batches = $plugin->getStaticConfig(
'upgrades');
69 if (empty($batches)) {
75 foreach ($batches as $class) {
83 return $pending_upgrades;
99 $upgrade_id =
"{$component_id}:{$version}";
114 $upgrade->title =
"{$component_id}:upgrade:{$version}:title";
115 $upgrade->description =
"{$component_id}:upgrade:{$version}:description";
134 if (!class_exists(
$class)) {
135 throw new \InvalidArgumentException(
"Upgrade class $class was not found");
139 throw new \InvalidArgumentException(
"Upgrade class $class should implement " .
Batch::class);
154 $upgrades = \Elgg\Database\Entities::find([
156 'subtype' =>
'elgg_upgrade',
157 'private_setting_name_value_pairs' => [
160 'value' => (
string) $upgrade_id,
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.
__construct(Plugins $plugins, LoggerInterface $logger)
Constructor.
static elgg()
Get the Elgg codebase path with "/".
Locates and registers both core and plugin upgrades.
trait Loggable
Enables adding a logger.
$upgrades
Lists pending upgrades.
const ELGG_IGNORE_ACCESS
elgg_call() flags
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.