Elgg  Version 6.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\Upgrade\Loop Class Reference

Upgrade loop Executes upgrade batches for a given duration of time. More...

Public Member Functions

 __construct (protected\ElggUpgrade $upgrade, protected Result $result, protected Progress $progress, Logger $logger)
 Constructor. More...
 
 loop (int $max_duration=null)
 Run upgrade loop for a preset number of seconds. More...
 

Protected Member Functions

 runBatch (ProgressBar $progress)
 Run batch. More...
 
 report ()
 Report loop results. More...
 
 canContinue ($started, int $max_duration=null)
 Check if the loop cand and should continue. More...
 
 isCompleted ()
 Check if upgrade has completed. More...
 

Protected Attributes

 $batch
 
int $max_duration
 
int $count
 
int $processed
 
int $offset
 

Detailed Description

Upgrade loop Executes upgrade batches for a given duration of time.

Definition at line 15 of file Loop.php.

Constructor & Destructor Documentation

Elgg\Upgrade\Loop::__construct ( protected\ElggUpgrade  $upgrade,
protected Result  $result,
protected Progress  $progress,
Logger  $logger 
)

Constructor.

Parameters
\ElggUpgrade$upgradeUpgrade instance
Result$resultUpgrade result
Progress$progressCLI progress helper
Logger$loggerLogger
Exceptions
RuntimeException

Definition at line 42 of file Loop.php.

Member Function Documentation

Elgg\Upgrade\Loop::canContinue (   $started,
int  $max_duration = null 
)
protected

Check if the loop cand and should continue.

Parameters
float$startedTimestamp of the loop initiation
int | null$max_durationMaximum loop duration
Returns
bool

Definition at line 188 of file Loop.php.

Elgg\Upgrade\Loop::isCompleted ( )
protected

Check if upgrade has completed.

Returns
bool

Definition at line 205 of file Loop.php.

Elgg\Upgrade\Loop::loop ( int  $max_duration = null)

Run upgrade loop for a preset number of seconds.

Parameters
int | null$max_durationMaximum loop duration
Returns
void

Definition at line 71 of file Loop.php.

Elgg\Upgrade\Loop::report ( )
protected

Report loop results.

Returns
void

Definition at line 150 of file Loop.php.

Elgg\Upgrade\Loop::runBatch ( ProgressBar  $progress)
protected

Run batch.

Parameters
ProgressBar$progressProgress bar helper
Returns
void

Definition at line 114 of file Loop.php.

Member Data Documentation

Elgg\Upgrade\Loop::$batch
protected

Definition at line 22 of file Loop.php.

int Elgg\Upgrade\Loop::$count
protected

Definition at line 26 of file Loop.php.

int Elgg\Upgrade\Loop::$max_duration
protected

Definition at line 24 of file Loop.php.

int Elgg\Upgrade\Loop::$offset
protected

Definition at line 30 of file Loop.php.

int Elgg\Upgrade\Loop::$processed
protected

Definition at line 28 of file Loop.php.


The documentation for this class was generated from the following file: