‪TYPO3CMS  11.5
TYPO3\CMS\Linkvalidator\Task\ValidatorTask Class Reference
Inheritance diagram for TYPO3\CMS\Linkvalidator\Task\ValidatorTask:
TYPO3\CMS\Scheduler\Task\AbstractTask

Public Member Functions

string getEmail ()
 
ValidatorTask setEmail (string $email)
 
bool getEmailOnBrokenLinkOnly ()
 
ValidatorTask setEmailOnBrokenLinkOnly (bool $emailOnBrokenLinkOnly)
 
int getPage ()
 
ValidatorTask setPage (int $page)
 
string getLanguages ()
 
ValidatorTask setLanguages (string $languages)
 
int getDepth ()
 
ValidatorTask setDepth (int $depth)
 
string getEmailTemplateName ()
 
ValidatorTask setEmailTemplateName (string $emailTemplateName)
 
string getConfiguration ()
 
ValidatorTask setConfiguration (string $configuration)
 
bool execute ()
 
string getAdditionalInformation ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Scheduler\Task\AbstractTask
 __construct ()
 
 setTaskUid ($id)
 
int getTaskUid ()
 
string getTaskTitle ()
 
string getTaskDescription ()
 
string getTaskClassName ()
 
bool isDisabled ()
 
 setDisabled ($flag)
 
 setRunOnNextCronJob ($flag)
 
bool getRunOnNextCronJob ()
 
 setExecutionTime ($timestamp)
 
int getTaskGroup ()
 
 setTaskGroup ($taskGroup)
 
int getExecutionTime ()
 
 setDescription ($description)
 
string getDescription ()
 
 setScheduler ()
 
 unsetScheduler ()
 
 registerSingleExecution ($timestamp)
 
 registerRecurringExecution ($start, $interval, $end=0, $multiple=false, $cron_cmd='')
 
 setExecution (Execution $execution)
 
Execution getExecution ()
 
int getNextDueExecution ()
 
bool areMultipleExecutionsAllowed ()
 
bool isExecutionRunning ()
 
int markExecution ()
 
 unmarkExecution ($executionID, \Throwable $e=null)
 
bool unmarkAllExecutions ()
 
bool save ()
 
 stop ()
 
 remove ()
 
int getType ()
 

Public Attributes

 $fluidEmail = $this->getFluidEmail()
 
 $validatorTaskEmailEvent = new ModifyValidatorTaskEmailEvent($linkAnalyzerResult, $fluidEmail, $this->modTSconfig)
 
if(!empty($this->modTSconfig['mail.']['subject']) && $fluidEmail->getSubject()===null) if($fluidEmail->getFrom()===[]) if($this->email !=='') if($fluidEmail->getTo()===[]) if($fluidEmail->getReplyTo()===[] &&GeneralUtility::validEmail($this->modTSconfig['mail.']['replytoemail'] ?? '')) try
 
catch(TransportExceptionInterface $e) return true
 
- ‪Public Attributes inherited from ‪TYPO3\CMS\Scheduler\Task\AbstractTask
const TYPE_SINGLE = 1
 
const TYPE_RECURRING = 2
 

Protected Member Functions

LinkAnalyzerResult getLinkAnalyzerResult ()
 
ValidatorTask loadModTSconfig ()
 
array getSearchField ()
 
array< int, getLinkTypes():array { $linkTypes=[];$typesTmp=GeneralUtility::trimExplode(',', $this->modTSconfig[ 'linktypes'], true);foreach( $GLOBALS[ 'TYPO3_CONF_VARS'][ 'EXTCONF'][ 'linkvalidator'][ 'checkLinks'] ??[] as $type=> $value) { if(in_array( $type, $typesTmp, true)) { $linkTypes[]=(string) $type;} } return $linkTypes;} protected bool function reportEmail(LinkAnalyzerResult $linkAnalyzerResult):bool { $lang=$this-> getLanguageService ()
 
ValidatorTask setCliArguments ()
 
FluidEmail getFluidEmail ()
 
bool templateFilesExist (array $templatePaths)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Scheduler\Task\AbstractTask
 logException (\Exception $e)
 

Protected Attributes

int $sleepTime
 
int $sleepAfterFinish
 
int $countInARun
 
string $configuration = ''
 
string $emailTemplateName = ''
 
int $depth = 0
 
int $page = 0
 
string $languages = ''
 
string $email = ''
 
bool $emailOnBrokenLinkOnly = true
 
string $languageFile = 'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf'
 
array $modTSconfig = array( )
 
bool $taskNeedsUpdate = false
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Scheduler\Task\AbstractTask
TYPO3 CMS Scheduler Scheduler null $scheduler
 
int $taskUid
 
bool $disabled = false
 
bool $runOnNextCronJob = false
 
Execution $execution
 
int $executionTime = 0
 
string $description = ''
 
int $taskGroup = 0
 

Detailed Description

This class provides Scheduler plugin implementation

This class is a specific Scheduler task implementation and is not part of the TYPO3's Core API.

Definition at line 39 of file ValidatorTask.php.

Member Function Documentation

◆ execute()

bool TYPO3\CMS\Linkvalidator\Task\ValidatorTask::execute ( )

Function execute from the Scheduler

Returns
‪bool TRUE on successful execution, FALSE on error

Reimplemented from TYPO3\CMS\Scheduler\Task\AbstractTask.

Definition at line 275 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getEmail(), TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getLinkAnalyzerResult(), and TYPO3\CMS\Scheduler\Task\AbstractTask\save().

◆ getAdditionalInformation()

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getAdditionalInformation ( )

Returns the most important properties of the LinkValidator task as a comma separated string that will be displayed in the scheduler module.

Returns
‪string

Reimplemented from TYPO3\CMS\Scheduler\Task\AbstractTask.

Definition at line 482 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$depth, TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$page, TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getEmail(), and TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getLanguageService().

◆ getConfiguration()

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getConfiguration ( )

Get the value of the protected property configuration

Returns
‪string specific TSconfig for this task

Definition at line 253 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$configuration.

◆ getDepth()

int TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getDepth ( )

Get the value of the protected property depth

Todo:
‪type cast needed for backwards compatibility - should be removed in v12
Returns
‪int Level of pages the task should check

Definition at line 209 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$depth.

◆ getEmail()

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getEmail ( )

Get the value of the protected property email

Returns
‪string Email address to which an email report is sent

Definition at line 118 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$email.

Referenced by TYPO3\CMS\Linkvalidator\Task\ValidatorTask\execute(), and TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getAdditionalInformation().

◆ getEmailOnBrokenLinkOnly()

bool TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getEmailOnBrokenLinkOnly ( )

Get the value of the protected property emailOnBrokenLinkOnly

Todo:
‪type cast needed for backwards compatibility - should be removed in v12
Returns
‪bool Whether to send an email, if new broken links were found

Definition at line 141 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$emailOnBrokenLinkOnly.

◆ getEmailTemplateName()

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getEmailTemplateName ( )

Get the value of the protected property emailTemplateName

Returns
‪string Template name to be used for the email

Definition at line 231 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$emailTemplateName.

◆ getFluidEmail()

FluidEmail TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getFluidEmail ( )
protected

◆ getLanguages()

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getLanguages ( )

Get the value of the protected property languages

Returns
‪string Languages to fetch broken links

Definition at line 186 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$languages.

◆ getLanguageService()

array<int, getLinkTypes(): array { $linkTypes = []; $typesTmp = GeneralUtility::trimExplode(',', $this->modTSconfig['linktypes'], true); foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] ?? [] as $type => $value) { if (in_array($type, $typesTmp, true)) { $linkTypes[] = (string)$type; } } return $linkTypes; } protected bool function reportEmail(LinkAnalyzerResult $linkAnalyzerResult): bool { $lang = $this-> TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getLanguageService ( )
protected

◆ getLinkAnalyzerResult()

LinkAnalyzerResult TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getLinkAnalyzerResult ( )
protected

Validate all broken links for pages set in the task configuration and return the analyzers result as object.

Returns
‪LinkAnalyzerResult

Definition at line 314 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getLanguageService(), and TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getSearchField().

Referenced by TYPO3\CMS\Linkvalidator\Task\ValidatorTask\execute().

◆ getPage()

int TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getPage ( )

Get the value of the protected property page

Todo:
‪type cast needed for backwards compatibility - should be removed in v12
Returns
‪int UID of the start page for this task

Definition at line 164 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$page.

◆ getSearchField()

array TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getSearchField ( )
protected

Get the list of fields to consider for fetching broken links

Returns
‪array $searchFields List of search fields

Definition at line 374 of file ValidatorTask.php.

References $fields, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getLinkAnalyzerResult().

◆ loadModTSconfig()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::loadModTSconfig ( )
protected

◆ setCliArguments()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::setCliArguments ( )
protected

Simulate cli call with setting the required options to the $_SERVER['argv']

Returns
ValidatorTask

Definition at line 509 of file ValidatorTask.php.

◆ setConfiguration()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::setConfiguration ( string  $configuration)

Set the value of the private property configuration

Parameters
string$configuration‪specific TSconfig for this task
Returns
ValidatorTask

Definition at line 264 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$configuration.

◆ setDepth()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::setDepth ( int  $depth)

Set the value of the private property depth

Parameters
int$depth‪Level of pages the task should check
Returns
ValidatorTask

Definition at line 220 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$depth.

◆ setEmail()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::setEmail ( string  $email)

Set the value of the private property email.

Parameters
string$email‪Email address to which an email report is sent
Returns
ValidatorTask

Definition at line 129 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$email.

◆ setEmailOnBrokenLinkOnly()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::setEmailOnBrokenLinkOnly ( bool  $emailOnBrokenLinkOnly)

Set the value of the private property emailOnBrokenLinkOnly

Parameters
bool$emailOnBrokenLinkOnly‪Only send an email, if new broken links were found
Returns
ValidatorTask

Definition at line 152 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$emailOnBrokenLinkOnly.

◆ setEmailTemplateName()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::setEmailTemplateName ( string  $emailTemplateName)

Set the value of the private property emailTemplateName

Parameters
string$emailTemplateName‪Template name to be used for the email
Returns
ValidatorTask

Definition at line 242 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$emailTemplateName.

◆ setLanguages()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::setLanguages ( string  $languages)

Set the value of the private property languages

Parameters
string$languages‪Languages to fetch broken links
Returns
ValidatorTask

Definition at line 197 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$languages.

◆ setPage()

ValidatorTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask::setPage ( int  $page)

Set the value of the private property page

Parameters
int$page‪UID of the start page for this task.
Returns
ValidatorTask

Definition at line 175 of file ValidatorTask.php.

References TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$page.

◆ templateFilesExist()

bool TYPO3\CMS\Linkvalidator\Task\ValidatorTask::templateFilesExist ( array  $templatePaths)
protected

Check if both template files (html and txt) exist under at least one template path

Parameters
array$templatePaths
Returns
‪bool

Definition at line 562 of file ValidatorTask.php.

Referenced by TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getFluidEmail().

Member Data Documentation

◆ $configuration

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$configuration = ''
protected

◆ $countInARun

int TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$countInARun
protected

Definition at line 51 of file ValidatorTask.php.

◆ $depth

int TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$depth = 0
protected

◆ $email

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$email = ''
protected

Email address to which an email report is sent

Definition at line 87 of file ValidatorTask.php.

Referenced by TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getEmail(), and TYPO3\CMS\Linkvalidator\Task\ValidatorTask\setEmail().

◆ $emailOnBrokenLinkOnly

bool TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$emailOnBrokenLinkOnly = true
protected

◆ $emailTemplateName

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$emailTemplateName = ''
protected

◆ $fluidEmail

TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$fluidEmail = $this->getFluidEmail()

◆ $languageFile

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$languageFile = 'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf'
protected

Default language file of the extension linkvalidator

Definition at line 99 of file ValidatorTask.php.

◆ $languages

string TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$languages = ''
protected

Languages to check for broken links

Definition at line 81 of file ValidatorTask.php.

Referenced by TYPO3\CMS\Linkvalidator\Task\ValidatorTask\getLanguages(), and TYPO3\CMS\Linkvalidator\Task\ValidatorTask\setLanguages().

◆ $modTSconfig

array TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$modTSconfig = array( )
protected

Merged mod TSconfig

Definition at line 105 of file ValidatorTask.php.

◆ $page

int TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$page = 0
protected

◆ $sleepAfterFinish

int TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$sleepAfterFinish
protected

Definition at line 47 of file ValidatorTask.php.

◆ $sleepTime

int TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$sleepTime
protected

Definition at line 43 of file ValidatorTask.php.

◆ $taskNeedsUpdate

bool TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$taskNeedsUpdate = false
protected

Defines if the task should be updated as some values have changed during task execution

Definition at line 111 of file ValidatorTask.php.

◆ $validatorTaskEmailEvent

TYPO3\CMS\Linkvalidator\Task\ValidatorTask::$validatorTaskEmailEvent = new ModifyValidatorTaskEmailEvent($linkAnalyzerResult, $fluidEmail, $this->modTSconfig)

Definition at line 415 of file ValidatorTask.php.

◆ true

catch (TransportExceptionInterface $e) return TYPO3\CMS\Linkvalidator\Task\ValidatorTask::true

Definition at line 473 of file ValidatorTask.php.

◆ try

if (!empty( $this->modTSconfig[ 'mail.'][ 'subject']) &&$fluidEmail->getSubject()===null) if ( $fluidEmail->getFrom()===[]) if ( $this->email !=='') if ( $fluidEmail->getTo()===[]) if ( $fluidEmail->getReplyTo()===[] &&GeneralUtility::validEmail( $this->modTSconfig[ 'mail.'][ 'replytoemail'] ?? '')) TYPO3\CMS\Linkvalidator\Task\ValidatorTask::try
Initial value:
{
GeneralUtility::makeInstance(Mailer::class)->send(‪$fluidEmail)

Definition at line 467 of file ValidatorTask.php.

‪TYPO3\CMS\Linkvalidator\Task\ValidatorTask\$fluidEmail
‪$fluidEmail
Definition: ValidatorTask.php:412