Elgg  Version 3.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 (ElggUpgrade $upgrade, Result $result, Progress $progress, Logger $logger)
 Constructor. More...
 
 loop ($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, $max_duration=null)
 Check if the loop cand and should continue. More...
 
 isCompleted ()
 Check if upgrade has completed. More...
 

Protected Attributes

 $upgrade
 
 $result
 
 $batch
 
 $max_duration
 
 $count
 
 $processed
 
 $offset
 
 $progress
 

Detailed Description

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

Definition at line 16 of file Loop.php.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 68 of file Loop.php.

Member Function Documentation

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

Check if the loop cand and should continue.

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

Definition at line 225 of file Loop.php.

Elgg\Upgrade\Loop::isCompleted ( )
protected

Check if upgrade has completed.

Returns
bool

Definition at line 241 of file Loop.php.

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

Run upgrade loop for a preset number of seconds.

Parameters
int$max_durationMaximum loop duration
Returns
void

Definition at line 101 of file Loop.php.

Elgg\Upgrade\Loop::report ( )
protected

Report loop results.

Returns
void

Definition at line 179 of file Loop.php.

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

Run batch.

Parameters
ProgressBar$progressProgress bar helper
Returns
void

Definition at line 144 of file Loop.php.

Member Data Documentation

Elgg\Upgrade\Loop::$batch
protected

Definition at line 33 of file Loop.php.

Elgg\Upgrade\Loop::$count
protected

Definition at line 43 of file Loop.php.

Elgg\Upgrade\Loop::$max_duration
protected

Definition at line 38 of file Loop.php.

Elgg\Upgrade\Loop::$offset
protected

Definition at line 53 of file Loop.php.

Elgg\Upgrade\Loop::$processed
protected

Definition at line 48 of file Loop.php.

Elgg\Upgrade\Loop::$progress
protected

Definition at line 58 of file Loop.php.

Elgg\Upgrade\Loop::$result
protected

Definition at line 28 of file Loop.php.

Elgg\Upgrade\Loop::$upgrade
protected

Definition at line 23 of file Loop.php.


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