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;
79 $upgrade_id =
"{$component_id}:{$version}";
113 if (!is_subclass_of(
$class, Batch::class)) {
129 $upgrades = \Elgg\Database\Entities::find([
131 'subtype' =>
'elgg_upgrade',
132 'metadata_name_value_pairs' => [
135 'value' => (
string) $upgrade_id,
155 $upgrades = \Elgg\Database\Entities::find([
157 'subtype' =>
'elgg_upgrade',
158 'metadata_name_value_pairs' => [
161 'value' => $class_name,
if(empty($guid)) $upgrade
$plugin_id
Remove all user and plugin settings from the give plugin ID.
Represents an upgrade that runs outside the upgrade.php script.
Persistent, installation-wide key-value storage.
Exception thrown if an argument is not of the expected type.
Allow executing scripts without $this context or local vars.
static includeFile($file)
Include a file with as little context as possible.
Find Elgg and project paths.
static elgg()
Get the Elgg codebase path with "/".
Long running upgrades should implement this interface.
Locates and registers both core and plugin upgrades.
__construct(protected Plugins $plugins)
Constructor.
locate()
Looks for upgrades and saves them as ElggUpgrade entities.
upgradeExists($upgrade_id)
Check if there already is an ElggUpgrade for this upgrade.
getUpgrade(string $class, string $component_id)
Gets instance of an ElggUpgrade based on the given class and id.
getUpgradeByClass(string $class_name)
Check if there already is an ElggUpgrade for this upgrade class.
getBatch(string $class, ?\ElggUpgrade $upgrade=null)
Validates class and returns an instance of batch.
const ELGG_IGNORE_ACCESS
elgg_call() flags
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.
$upgrades
Lists pending upgrades.