Elgg  Version 4.3
upgrade.php
Go to the documentation of this file.
1 <?php
6 $guid = (int) get_input('guid');
7 if (empty($guid)) {
8  return elgg_error_response(elgg_echo('error:missing_data'));
9 }
10 
12 if (!$upgrade instanceof \ElggUpgrade) {
13  return elgg_error_response(elgg_echo('admin:upgrades:error:invalid_upgrade', [$guid]), REFERER, ELGG_HTTP_NOT_FOUND);
14 }
15 
16 $result = _elgg_services()->upgrades->executeUpgrade($upgrade);
17 
18 return elgg_ok_response($result->toArray());
if(!$upgrade instanceof\ElggUpgrade) $result
Definition: upgrade.php:16
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
if(empty($guid)) $upgrade
Definition: upgrade.php:11
Represents an upgrade that runs outside of the upgrade.php script.
Definition: ElggUpgrade.php:26
get_input($variable, $default=null, $filter_result=true)
Parameter input functions.
Definition: input.php:20
const REFERER
Definition: constants.php:52
const ELGG_HTTP_NOT_FOUND
Definition: constants.php:83
elgg_error_response($message= '', $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
elgg_ok_response($content= '', $message= '', $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:638
$guid
Runs batch upgrades.
Definition: upgrade.php:6
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:69