Abstract Class AKAbstractPart

Description

The superclass of all Akeeba Kickstart parts. The "parts" are intelligent stateful

classes which perform a single procedure and have preparation, running and finalization phases. The transition between phases is handled automatically by this superclass' tick() final public method, which should be the ONLY public API exposed to the rest of the Akeeba Engine.

  • abstract:

Located in /administrator/components/com_joomlaupdate/restore.php (line 1656)

AKAbstractObject
   |
   --AKAbstractPart
Direct descendents
Class Description
Abstract class AKAbstractUnarchiver The base class of unarchiver classes
Variable Summary
 string $active_step
 string $databaseRoot
 boolean $hasRan
 boolean $isFinished
 boolean $isPrepared
 boolean $isRunning
 array $observers
Method Summary
 void getDomain ()
 string getState ()
 array getStatusArray ()
 void getStep ()
 void getSubstep ()
 void notify (mixed $message)
 void setBreakFlag ()
 void setDomain ( $new_domain)
 void setState ([string $state = 'init'], [string $errorMessage = 'Invalid setState argument'])
 void setStep ( $new_step)
 void setSubstep ( $new_substep)
 void setup (array $parametersArray)
 array tick ()
 void _finalize ()
 array _makeReturnTable ()
 void _prepare ()
 void _run ()
Variables
string $active_domain = "" (line 1687)

The name of the engine part (a.k.a. Domain), used in return table generation.

  • access: protected
string $active_step = "" (line 1694)

The step this engine part is in. Used verbatim in return table and should be set by the code in the _run() method.

  • access: protected
string $active_substep = "" (line 1702)

A more detailed description of the step this engine part is in. Used verbatim in return table and should be set by the code in the _run() method.

  • access: protected
string $databaseRoot = array() (line 1711)
  • var: The database root key
  • access: protected
boolean $hasRan = false (line 1680)

Indicates whether this part has finished its run cycle

  • access: protected
boolean $isFinished = false (line 1674)

Indicates whether this part has finished its finalization cycle

  • access: protected
boolean $isPrepared = false (line 1662)

Indicates whether this part has finished its initialisation cycle

  • access: protected
boolean $isRunning = false (line 1668)

Indicates whether this part has more work to do (it's in running state)

  • access: protected
array $observers = array() (line 1717)
  • var: An array of observers
  • access: protected
array $_parametersArray = array() (line 1708)

Any configuration variables, in the form of an array.

  • access: protected

Inherited Variables

Inherited from AKAbstractObject

AKAbstractObject::$_errors_queue_size
AKAbstractObject::$_warnings_queue_size
Methods
attach (line 1972)

Attaches an observer object

void attach (AKAbstractPartObserver $obs)
detach (line 1980)

Dettaches an observer object

void detach (AKAbstractPartObserver $obs)
getDomain (line 1943)
  • access: public
void getDomain ()
getState (line 1871)

Returns the state of this engine part.

  • return: The state of this engine part. It can be one of error, init, prepared, running, postrun, finished.
  • access: public
string getState ()
getStatusArray (line 1834)

Returns a copy of the class's status array

  • access: public
array getStatusArray ()
getStep (line 1953)
  • access: public
void getStep ()
getSubstep (line 1963)
  • access: public
void getSubstep ()
notify (line 1988)

Notifies observers each time something interesting happened to the part

  • access: protected
void notify (mixed $message)
  • mixed $message: The event object
setBreakFlag (line 1743)

Sets the BREAKFLAG, which instructs this engine part that the current step must break immediately, in fear of timing out.

  • access: protected
void setBreakFlag ()
setDomain (line 1938)
  • access: protected
void setDomain ( $new_domain)
  • $new_domain
setState (line 1754)

Sets the engine part's internal state, in an easy to use manner

  • access: protected
void setState ([string $state = 'init'], [string $errorMessage = 'Invalid setState argument'])
  • string $state: One of init, prepared, running, postrun, finished, error
  • string $errorMessage: The reported error message, should the state be set to error
setStep (line 1948)
  • access: protected
void setStep ( $new_step)
  • $new_step
setSubstep (line 1958)
  • access: protected
void setSubstep ( $new_substep)
  • $new_substep
setup (line 1849)

Sends any kind of setup information to the engine part. Using this,

we avoid passing parameters to the constructor of the class. These parameters should be passed as an indexed array and should be taken into account during the preparation process only. This function will set the error flag if it's called after the engine part is prepared.

  • access: public
void setup (array $parametersArray)
  • array $parametersArray: The parameters to be passed to the engine part.
tick (line 1806)

The public interface to an engine part. This method takes care for calling the correct method in order to perform the initialisation - run - finalisation cycle of operation and return a proper reponse array.

  • return: A Reponse Array
  • access: public
array tick ()
_finalize (line 1729)

Runs the finalisation process for this part. Should set _isFinished to true.

  • abstract:
  • access: protected
void _finalize ()

Redefined in descendants as:
_makeReturnTable (line 1908)

Constructs a Response Array based on the engine part's state.

  • return: The Response Array for the current state
  • access: protected
array _makeReturnTable ()
_prepare (line 1723)

Runs the preparation for this part. Should set _isPrepared

to true

  • abstract:
  • access: protected
void _prepare ()

Redefined in descendants as:
_run (line 1737)

Runs the main functionality loop for this part. Upon calling, should set the _isRunning to true. When it finished, should set the _hasRan to true. If an error is encountered, setError should be used.

  • abstract:
  • access: protected
void _run ()

Redefined in descendants as:

Inherited Methods

Inherited From AKAbstractObject

 AKAbstractObject::__construct()
 AKAbstractObject::getError()
 AKAbstractObject::getErrors()
 AKAbstractObject::getWarning()
 AKAbstractObject::getWarnings()
 AKAbstractObject::propagateFromObject()
 AKAbstractObject::propagateToObject()
 AKAbstractObject::resetErrors()
 AKAbstractObject::resetWarnings()
 AKAbstractObject::setError()
 AKAbstractObject::setErrorsQueueSize()
 AKAbstractObject::setWarning()
 AKAbstractObject::setWarningsQueueSize()

Documentation generated on Tue, 19 Nov 2013 15:12:15 +0100 by phpDocumentor 1.4.3