\AKAbstractUnarchiver
The base class of unarchiver classes
Synopsis
class AKAbstractUnarchiver
extends AKAbstractPart
{
- // members
- protected $filename;
- public $archiveList;
- public $totalSize;
- protected $currentPartNumber;
- protected $currentPartOffset;
- protected bool $flagRestorePermissions;
- protected AKAbstractPostproc $postProcEngine;
- protected $addPath;
- public $renameFiles;
- public $renameDirs;
- public $skipFiles;
- protected $chunkSize;
- protected $fp;
- protected $runState;
- protected stdClass $fileHeader;
- protected $dataReadLength;
- // Inherited members from AKAbstractPart
- protected $isPrepared;
- protected $isRunning;
- protected $isFinished;
- protected $hasRan;
- protected $active_domain;
- protected $active_step;
- protected $active_substep;
- protected $_parametersArray;
- protected $databaseRoot;
- protected $observers;
- // Inherited members from AKAbstractObject
- protected $_errors_queue_size;
- protected $_warnings_queue_size;
- // methods
- public void __construct()
- public void __wakeup()
- public void shutdown()
- protected final void _prepare()
- protected void _run()
- protected void _finalize()
- private string getBaseExtension()
- private void scanArchives()
- protected void nextFile()
- protected bool isEOF()
- protected void setCorrectPermissions()
- protected abstract void readArchiveHeader()
- protected abstract bool readFileHeader()
- protected abstract bool processFileData()
- protected void fread()
- // Inherited methods from AKAbstractPart
- protected abstract void _prepare()
- protected abstract void _finalize()
- protected abstract void _run()
- protected void setBreakFlag()
- protected void setState()
- public final array tick()
- public array getStatusArray()
- public final void setup()
- public final string getState()
- protected final array _makeReturnTable()
- protected final void setDomain()
- public final void getDomain()
- protected final void setStep()
- public final void getStep()
- protected final void setSubstep()
- public final void getSubstep()
- public void attach()
- public void detach()
- protected void notify()
- // Inherited methods from AKAbstractObject
- public void __construct()
- public string getError()
- public array getErrors()
- public void setError()
- public void resetErrors()
- public string getWarning()
- public array getWarnings()
- public void setWarning()
- public void resetWarnings()
- public void propagateToObject()
- public void propagateFromObject()
- protected void setErrorsQueueSize()
- protected void setWarningsQueueSize()
Hierarchy
Members
protected
- $_errors_queue_size — array
- $_parametersArray
—
array
Any configuration variables, in the form of an array. - $_warnings_queue_size — array
- $active_domain
—
string
The name of the engine part (a.k.a. Domain), used in return table generation. - $active_step
—
string
The step this engine part is in. Used verbatim in return table and should be set by the code in the _run() method. - $active_substep
—
string
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. - $addPath — string
- $chunkSize — integer
- $currentPartNumber — integer
- $currentPartOffset — integer
- $dataReadLength — int
- $databaseRoot — string
- $fileHeader — stdClass
- $filename — string
- $flagRestorePermissions — bool
- $fp — resource
- $hasRan
—
boolean
Indicates whether this part has finished its run cycle - $isFinished
—
boolean
Indicates whether this part has finished its finalization cycle - $isPrepared
—
boolean
Indicates whether this part has finished its initialisation cycle - $isRunning
—
boolean
Indicates whether this part has more work to do (it's in running state) - $observers — array
- $postProcEngine — AKAbstractPostproc
- $runState — int
public
- $archiveList — array
- $renameDirs — array
- $renameFiles — array
- $skipFiles — array
- $totalSize — int
Methods
private
- getBaseExtension() — Returns the base extension of the file, e.g. '.jpa'
- scanArchives() — Scans for archive parts
protected
- _finalize()
- _prepare() — Implements the abstract _prepare() method
- _run()
- fread() — Reads data from the archive and notifies the observer with the 'reading' message
- isEOF() — Returns true if we have reached the end of file
- nextFile() — Opens the next part file for reading
- processFileData() — Concrete classes must use this method to process file data. It must set $runState to AK_STATE_DATAREAD when it's finished processing the file data.
- readArchiveHeader() — Concrete classes are supposed to use this method in order to read the archive's header and prepare themselves to the point of being ready to extract the first file.
- readFileHeader() — Concrete classes must use this method to read the file header
- setCorrectPermissions() — Tries to make a directory user-writable so that we can write a file to it
public
- __construct() — Public constructor
- __wakeup() — Wakeup function, called whenever the class is unserialized
- shutdown() — Sleep function, called whenever the class is serialized
Inherited from AKAbstractPart
protected
- _finalize() — Runs the finalisation process for this part. Should set _isFinished to true.
- _makeReturnTable() — Constructs a Response Array based on the engine part's state.
- _prepare() — Runs the preparation for this part. Should set _isPrepared to true
- _run() — 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.
- notify() — Notifies observers each time something interesting happened to the part
- setBreakFlag() — Sets the BREAKFLAG, which instructs this engine part that the current step must break immediately, in fear of timing out.
- setDomain()
- setState() — Sets the engine part's internal state, in an easy to use manner
- setStep()
- setSubstep()
public
- attach() — Attaches an observer object
- detach() — Dettaches an observer object
- getDomain()
- getState() — Returns the state of this engine part.
- getStatusArray() — Returns a copy of the class's status array
- getStep()
- getSubstep()
- setup() — 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.
- tick() — 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.
Inherited from AKAbstractObject
protected
- setErrorsQueueSize() — Sets the size of the error queue (acts like a LIFO buffer)
- setWarningsQueueSize() — Sets the size of the warnings queue (acts like a LIFO buffer)
public
- getError() — Get the most recent error message
- getErrors() — Return all errors, if any
- getWarning() — Get the most recent warning message
- getWarnings() — Return all warnings, if any
- propagateFromObject() — Propagates errors and warnings from a foreign object. Each propagated list is then cleared on the foreign object, as long as it implements resetErrors() and/or resetWarnings() methods.
- propagateToObject() — Propagates errors and warnings to a foreign object. The foreign object SHOULD implement the setError() and/or setWarning() methods but DOESN'T HAVE TO be of AKAbstractObject type. For example, this can even be used to propagate to a JObject instance in Joomla!. Propagated items will be removed from ourself.
- resetErrors() — Resets all error messages
- resetWarnings() — Resets all warning messages
- setError() — Add an error message
- setWarning() — Add an error message