TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Resource\Processing\AbstractTask Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Processing\AbstractTask:
TYPO3\CMS\Core\Resource\Processing\TaskInterface TYPO3\CMS\Core\Resource\Processing\AbstractGraphicalTask TYPO3\CMS\Core\Resource\Processing\ImageCropScaleMaskTask TYPO3\CMS\Core\Resource\Processing\ImagePreviewTask

Public Member Functions

 __construct (Resource\ProcessedFile $targetFile, array $configuration)
 
 getConfigurationChecksum ()
 
 getTargetFilename ()
 
 getTargetFileExtension ()
 
 getName ()
 
 getType ()
 
 getTargetFile ()
 
 setTargetFile (Resource\ProcessedFile $targetFile)
 
 getSourceFile ()
 
 setSourceFile (Resource\File $sourceFile)
 
 getConfiguration ()
 
 isExecuted ()
 
 setExecuted ($successful)
 
 isSuccessful ()
 
- Public Member Functions inherited from TYPO3\CMS\Core\Resource\Processing\TaskInterface
 getTargetFileName ()
 
 fileNeedsProcessing ()
 

Protected Member Functions

 getChecksumData ()
 
 isValidConfiguration (array $configuration)
 

Protected Attributes

 $checksumData = []
 
 $targetFile
 
 $sourceFile
 
 $configuration
 
 $type
 
 $name
 
 $executed = false
 
 $successful
 

Detailed Description

Abstract base implementation of a task.

If you extend this class, make sure that you redefine the member variables $type and $name or set them in the constructor. Otherwise your task won't be recognized by the system and several things will fail.

Definition at line 27 of file AbstractTask.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::__construct ( Resource\ProcessedFile  $targetFile,
array  $configuration 
)
Parameters
Resource\ProcessedFile$targetFile
array$configuration

Implements TYPO3\CMS\Core\Resource\Processing\TaskInterface.

Definition at line 73 of file AbstractTask.php.

References TYPO3\CMS\Core\Resource\Processing\AbstractTask\$configuration, and TYPO3\CMS\Core\Resource\Processing\AbstractTask\$targetFile.

Member Function Documentation

◆ getChecksumData()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::getChecksumData ( )
protected

Sets parameters needed in the checksum. Can be overridden to add additional parameters to the checksum. This should include all parameters that could possibly vary between different task instances, e.g. the TYPO3 image configuration in TYPO3_CONF_VARS[GFX] for graphic processing tasks.

Returns
array

Definition at line 87 of file AbstractTask.php.

References TYPO3\CMS\Core\Resource\Processing\AbstractTask\getName(), TYPO3\CMS\Core\Resource\Processing\AbstractTask\getSourceFile(), and TYPO3\CMS\Core\Resource\Processing\AbstractTask\getType().

Referenced by TYPO3\CMS\Core\Resource\Processing\AbstractTask\getConfigurationChecksum().

◆ getConfiguration()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::getConfiguration ( )

◆ getConfigurationChecksum()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::getConfigurationChecksum ( )

◆ getName()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::getName ( )

◆ getSourceFile()

◆ getTargetFile()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::getTargetFile ( )

◆ getTargetFileExtension()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::getTargetFileExtension ( )

Gets the file extension the processed file should have in the filesystem.

Returns
string

Implements TYPO3\CMS\Core\Resource\Processing\TaskInterface.

Definition at line 124 of file AbstractTask.php.

Referenced by TYPO3\CMS\Core\Resource\Processing\AbstractTask\getTargetFilename().

◆ getTargetFilename()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::getTargetFilename ( )

◆ getType()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::getType ( )

◆ isExecuted()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::isExecuted ( )

Returns TRUE if this task has been executed, no matter if the execution was successful.

Returns
bool

Implements TYPO3\CMS\Core\Resource\Processing\TaskInterface.

Definition at line 203 of file AbstractTask.php.

References TYPO3\CMS\Core\Resource\Processing\AbstractTask\$executed.

◆ isSuccessful()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::isSuccessful ( )

Returns TRUE if this task has been successfully executed. Only call this method if the task has been processed at all.

Returns
bool
Exceptions

Implements TYPO3\CMS\Core\Resource\Processing\TaskInterface.

Definition at line 227 of file AbstractTask.php.

References TYPO3\CMS\Core\Resource\Processing\AbstractTask\$successful.

◆ isValidConfiguration()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::isValidConfiguration ( array  $configuration)
abstractprotected

Checks if the given configuration is sensible for this task, i.e. if all required parameters are given, within the boundaries and don't conflict with each other.

Parameters
array$configuration
Returns
bool

Referenced by TYPO3\CMS\Core\Resource\Processing\AbstractTask\getConfiguration().

◆ setExecuted()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::setExecuted (   $successful)

Set this task executed. This is used by the Processors in order to transfer the state of this task to the file processing service.

Parameters
bool$successfulSet this to FALSE if executing the task failed
Returns
void

Implements TYPO3\CMS\Core\Resource\Processing\TaskInterface.

Definition at line 215 of file AbstractTask.php.

References TYPO3\CMS\Core\Resource\Processing\AbstractTask\$successful.

◆ setSourceFile()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::setSourceFile ( Resource\File  $sourceFile)
Parameters
Resource\File$sourceFile

Definition at line 176 of file AbstractTask.php.

References TYPO3\CMS\Core\Resource\Processing\AbstractTask\$sourceFile.

◆ setTargetFile()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::setTargetFile ( Resource\ProcessedFile  $targetFile)
Parameters
Resource\ProcessedFile$targetFile

Definition at line 160 of file AbstractTask.php.

References TYPO3\CMS\Core\Resource\Processing\AbstractTask\$targetFile.

Member Data Documentation

◆ $checksumData

TYPO3\CMS\Core\Resource\Processing\AbstractTask::$checksumData = []
protected

Definition at line 32 of file AbstractTask.php.

◆ $configuration

TYPO3\CMS\Core\Resource\Processing\AbstractTask::$configuration
protected

◆ $executed

TYPO3\CMS\Core\Resource\Processing\AbstractTask::$executed = false
protected

◆ $name

TYPO3\CMS\Core\Resource\Processing\AbstractTask::$name
protected

◆ $sourceFile

TYPO3\CMS\Core\Resource\Processing\AbstractTask::$sourceFile
protected

◆ $successful

TYPO3\CMS\Core\Resource\Processing\AbstractTask::$successful
protected

◆ $targetFile

◆ $type

TYPO3\CMS\Core\Resource\Processing\AbstractTask::$type
protected