30 private $requiredProperties = [
43 parent::initializeAttributes();
45 $this->attributes[
'subtype'] =
'elgg_upgrade';
48 $this->attributes[
'container_guid'] = 0;
49 $this->attributes[
'owner_guid'] = 0;
60 $this->is_completed =
true;
71 return (
bool) $this->is_completed;
91 $this->
class = $class;
99 return !is_subclass_of($this->
class, \
Elgg\Upgrade\SystemUpgrade::class);
112 $loglevel = $this->
isCompleted() ? \Psr\Log\LogLevel::INFO : \Psr\Log\LogLevel::ERROR;
113 elgg_log($ex->getMessage(), $loglevel);
123 elgg_log(
"Upgrade {$this->class} returned an invalid version: {$version}");
147 return (
int) $this->completed_time;
156 unset($this->is_completed);
157 unset($this->completed_time);
158 unset($this->processed);
159 unset($this->offset);
160 unset($this->start_time);
172 if (isset($this->start_time)) {
185 return (
int) $this->start_time;
193 if (!isset($this->is_completed)) {
194 $this->is_completed =
false;
197 foreach ($this->requiredProperties as $prop) {
203 return parent::save();
isCompleted()
Has this upgrade completed?
setClass(string $class)
Sets a class for the upgrade.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
if(!$annotation instanceof ElggAnnotation) $time
getStartTime()
Gets the time when the upgrade completed.
isAsynchronous()
Check if the upgrade should be run asynchronously.
trait TimeUsing
Adds methods for setting the current time (for testing)
initializeAttributes()
Set subtype to upgrade.
setCompletedTime(int $time=null)
Sets the timestamp for when the upgrade completed.
getCurrentTime($modifier= '')
Get the (cloned) time.
getCompletedTime()
Gets the time when the upgrade completed.
getBatch()
Return instance of the class that processes the data.
Represents an upgrade that runs outside of the upgrade.php script.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
Long running upgrades should implement this interface.
setStartTime(int $time=null)
Sets the timestamp for when the upgrade started.
setCompleted()
Mark this upgrade as completed.
setID(string $id)
Sets an unique id for the upgrade.
reset()
Resets the update in order to be able to run it again.
_elgg_services()
Get the global service provider.
elgg_trigger_event(string $event, string $type, $object=null)
Trigger an Elgg Event and attempt to run all handler callbacks registered to that event...
$id
Generic annotation delete action.