Open Monograph Press  3.3.0
FileLoader Class Reference
Inheritance diagram for FileLoader:
ScheduledTask UsageStatsLoader

Public Member Functions

 __construct ($args)
 
 checkFolderStructure ($install=false)
 
 getArchivePath ()
 
 getCompressArchives ()
 
 getProcessingPath ()
 
 getRejectPath ()
 
 getStagePath ()
 
 setCompressArchives ($compressArchives)
 
- Public Member Functions inherited from ScheduledTask
 addExecutionLogEntry ($message, $type=null)
 
 execute ()
 
 getHelper ()
 
 getName ()
 
 getProcessId ()
 

Protected Member Functions

 executeActions ()
 
 moveFile ($sourceDir, $destDir, $filename)
 
 processFile ($filePath)
 

Detailed Description

Base scheduled task class to reliably handle files processing.

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

Constructor & Destructor Documentation

◆ __construct()

FileLoader::__construct (   $args)

Constructor.

Parameters
$argsarray script arguments

Reimplemented from ScheduledTask.

Reimplemented in UsageStatsLoader.

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

References DAORegistry\getDAO(), and AppLocale\requireComponents().

Member Function Documentation

◆ checkFolderStructure()

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 233 of file FileLoader.inc.php.

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

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

◆ executeActions()

FileLoader::executeActions ( )
protected

Implement this method to execute the task actions.

Returns
boolean true iff success

Reimplemented from ScheduledTask.

Reimplemented in UsageStatsLoader.

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

References ScheduledTask\addExecutionLogEntry(), checkFolderStructure(), and processFile().

◆ getArchivePath()

FileLoader::getArchivePath ( )

Return the archive path.

Returns
string

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

◆ getCompressArchives()

FileLoader::getCompressArchives ( )

Return whether the archives must be compressed or not.

Returns
boolean

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

◆ getProcessingPath()

FileLoader::getProcessingPath ( )

Return the processing path.

Returns
string

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

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

◆ getRejectPath()

FileLoader::getRejectPath ( )

Return the reject path.

Returns
string

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

◆ getStagePath()

FileLoader::getStagePath ( )

Return the staging path.

Returns
string

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

Referenced by UsageStatsLoader\autoStage().

◆ moveFile()

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

Move file between filesystem directories.

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

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

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

Referenced by UsageStatsLoader\autoStage().

◆ processFile()

FileLoader::processFile (   $filePath)
abstractprotected

Process the passed file.

Parameters
$filePathstring
Returns
mixed
See also
FileLoader::execute to understand the expected return values.

Reimplemented in UsageStatsLoader.

Referenced by executeActions().

◆ setCompressArchives()

FileLoader::setCompressArchives (   $compressArchives)

Set whether the archives must be compressed or not.

Parameters
$compressArchivesboolean

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

Referenced by UsageStatsLoader\__construct().


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