‪TYPO3CMS  ‪main
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\ImageCropScaleMaskTask TYPO3\CMS\Core\Resource\Processing\ImagePreviewTask

Public Member Functions

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

Protected Member Functions

 getChecksumData ()
 

Protected Attributes

Resource File $sourceFile
 
bool $executed = false
 
bool $successful
 

Detailed Description

Abstract base implementation of a processing task.

Definition at line 28 of file AbstractTask.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ fileNeedsProcessing()

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

We only have to trigger the file processing if the file either is new, does not exist or the original file has changed since the last processing run (the last case has to trigger a reprocessing even if the original file was used until now).

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

Definition at line 146 of file AbstractTask.php.

References TYPO3\CMS\Core\Resource\Processing\AbstractTask\getTargetFile().

◆ 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.

Definition at line 46 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 ( )

Returns the configuration for this task.

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

Definition at line 102 of file AbstractTask.php.

◆ getConfigurationChecksum()

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

◆ getName()

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

◆ getSourceFile()

◆ getTargetFile()

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

Returns the processed file this task is executed on.

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

Definition at line 92 of file AbstractTask.php.

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

◆ getTargetFileExtension()

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

◆ getTargetFilename()

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

◆ getType()

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

◆ isExecuted()

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

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

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

Definition at line 110 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.

Exceptions

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

Definition at line 133 of file AbstractTask.php.

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

◆ sanitizeConfiguration()

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

Can be extended in the actual subclasses, but be careful on what to sanitize, as Processors might need information that you actually throw away.

Ensure that the processing configuration which is part of the hash sum is properly cast, so unnecessary duplicate images are not produced, see #80942

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

Reimplemented in TYPO3\CMS\Core\Resource\Processing\ImagePreviewTask.

Definition at line 162 of file AbstractTask.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger().

◆ setExecuted()

TYPO3\CMS\Core\Resource\Processing\AbstractTask::setExecuted ( bool  $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$successful‪Set this to FALSE if executing the task failed

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

Definition at line 121 of file AbstractTask.php.

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

Member Data Documentation

◆ $executed

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

◆ $sourceFile

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

◆ $successful

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