Open Journal Systems  2.4.8
 All Classes Namespaces Functions Variables Groups Pages
FileLoader Class Reference
Inheritance diagram for FileLoader:
ScheduledTask UsageStatsLoader

Public Member Functions

 _archiveFile ()
 
 _claimNextFile ()
 
 _rejectFile ()
 
 _stageFile ()
 
 checkFolderStructure ($install=false)
 
 executeActions ()
 
 FileLoader ($args)
 
 getArchivePath ()
 
 getCompressArchives ()
 
 getName ()
 
 getProcessingPath ()
 
 getRejectPath ()
 
 getStagePath ()
 
 moveFile ($sourceDir, $destDir, $filename)
 
 processFile ($filePath, &$errorMsg)
 
 setCompressArchives ($compressArchives)
 
- Public Member Functions inherited from ScheduledTask
 addExecutionLogEntry ($message, $type=null)
 
 execute ()
 
 executeActions ()
 
getHelper ()
 
 getName ()
 
 getProcessId ()
 
 ScheduledTask ($args=array())
 

Detailed Description

Base scheduled task class to reliably handle files processing.

Definition at line 24 of file FileLoader.inc.php.

Member Function Documentation

FileLoader::_archiveFile ( )

Archive the current claimed file.

Definition at line 312 of file FileLoader.inc.php.

References ScheduledTask\addExecutionLogEntry(), getCompressArchives(), and moveFile().

Referenced by executeActions().

FileLoader::_claimNextFile ( )

Claim the first file that's inside the staging folder.

Returns
mixed The claimed file path or false if the claim was not successful.

Definition at line 270 of file FileLoader.inc.php.

References ScheduledTask\addExecutionLogEntry(), and moveFile().

Referenced by executeActions().

FileLoader::_rejectFile ( )

Reject the current claimed file.

Definition at line 305 of file FileLoader.inc.php.

References moveFile().

Referenced by executeActions().

FileLoader::_stageFile ( )

Stage the current claimed file.

Definition at line 329 of file FileLoader.inc.php.

References moveFile().

Referenced by executeActions().

FileLoader::checkFolderStructure (   $install = false)

A public helper function that can be used to ensure that the file structure has actually been installed.

Parameters
$installboolean Set this parameter to true to install the folder structure if it is missing.
Returns
boolean True if the folder structure exists, otherwise false.

Definition at line 192 of file FileLoader.inc.php.

References ScheduledTask\addExecutionLogEntry(), and Config\getVar().

Referenced by executeActions(), and UsageStatsLoader\UsageStatsLoader().

FileLoader::FileLoader (   $args)

Constructor.

Parameters
$argsarray script arguments

Definition at line 54 of file FileLoader.inc.php.

References DAORegistry\getDAO().

FileLoader::getArchivePath ( )

Return the archive path.

Returns
string

Definition at line 117 of file FileLoader.inc.php.

FileLoader::getCompressArchives ( )

Return whether the archives must be compressed or not.

Returns
boolean

Definition at line 125 of file FileLoader.inc.php.

Referenced by _archiveFile().

FileLoader::getName ( )
See Also
ScheduledTask::getName()

Definition at line 257 of file FileLoader.inc.php.

FileLoader::getProcessingPath ( )

Return the processing path.

Returns
string

Definition at line 101 of file FileLoader.inc.php.

Referenced by UsageStatsLoader\autoStage(), and UsageStatsLoader\executeActions().

FileLoader::getRejectPath ( )

Return the reject path.

Returns
string

Definition at line 109 of file FileLoader.inc.php.

FileLoader::getStagePath ( )

Return the staging path.

Returns
string

Definition at line 93 of file FileLoader.inc.php.

Referenced by UsageStatsLoader\autoStage().

FileLoader::moveFile (   $sourceDir,
  $destDir,
  $filename 
)

Move file between filesystem directories.

Parameters
$sourceDirstring
$destDirstring
$filenamestring
Returns
string The destination path of the moved file.

Definition at line 340 of file FileLoader.inc.php.

References ScheduledTask\addExecutionLogEntry().

Referenced by _archiveFile(), _claimNextFile(), _rejectFile(), _stageFile(), and UsageStatsLoader\autoStage().

FileLoader::processFile (   $filePath,
$errorMsg 
)

Abstract method that must be implemented by subclasses to process the passed file.

Parameters
$filePathstring
$errorMsgstring Define a custom error message to be used to notify the administrator about the error. This message will be used if the return value is false.
Returns
mixed
See Also
FileLoader::execute to understand the expected return values.

Definition at line 250 of file FileLoader.inc.php.

Referenced by executeActions().

FileLoader::setCompressArchives (   $compressArchives)

Set whether the archives must be compressed or not.

Parameters
$compressArchivesboolean

Definition at line 133 of file FileLoader.inc.php.

Referenced by UsageStatsLoader\UsageStatsLoader().


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