‪TYPO3CMS  ‪main
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 ()
 
 setEmail (string $email)
 
bool getEmailOnBrokenLinkOnly ()
 
 setEmailOnBrokenLinkOnly (bool $emailOnBrokenLinkOnly)
 
int getPage ()
 
 setPage (int $page)
 
string getLanguages ()
 
 setLanguages (string $languages)
 
int getDepth ()
 
 setDepth (int $depth)
 
string getEmailTemplateName ()
 
 setEmailTemplateName (string $emailTemplateName)
 
string getConfiguration ()
 
 setConfiguration (string $configuration)
 
bool execute ()
 
 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 null 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 object null getExecution ()
 
int getNextDueExecution ()
 
bool areMultipleExecutionsAllowed ()
 
bool save ()
 
 stop ()
 
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

 getLinkAnalyzerResult ()
 
 loadModTSconfig ()
 
array getSearchField ()
 
array< int, getLinkTypes():array { $linkTypes=[];$typesTmp=GeneralUtility::trimExplode(',', $this->modTSconfig[ 'linktypes'], true);foreach(GeneralUtility::makeInstance(LinktypeRegistry::class) ->getIdentifiers() as $identifier) { if(in_array( $identifier, $typesTmp, true)) { $linkTypes[]=$identifier;} } return $linkTypes;} protected bool function reportEmail(LinkAnalyzerResult $linkAnalyzerResult):bool { $lang=$this-> getLanguageService ()
 
 setCliArguments ()
 
 getFluidEmail ()
 
 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 = 0
 
bool $disabled = false
 
bool $runOnNextCronJob = false
 
Execution $execution
 
int $executionTime = 0
 
string $description = ''
 
int null $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 42 of file ValidatorTask.php.

Member Function Documentation

◆ execute()

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

◆ getAdditionalInformation()

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.

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

Definition at line 451 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 244 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

Returns
‪int Level of pages the task should check

Definition at line 202 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

Returns
‪bool Whether to send an email, if new broken links were found

Definition at line 139 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 223 of file ValidatorTask.php.

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

◆ getFluidEmail()

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 181 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 (GeneralUtility::makeInstance(LinktypeRegistry::class)->getIdentifiers() as $identifier) { if (in_array($identifier, $typesTmp, true)) { $linkTypes[] = $identifier; } } return $linkTypes; } protected bool function reportEmail(LinkAnalyzerResult $linkAnalyzerResult): bool { $lang = $this-> TYPO3\CMS\Linkvalidator\Task\ValidatorTask::getLanguageService ( )
protected

Get the list of linkTypes to consider for fetching broken links

Returns
‪array<int, string> $linkTypes list of link types

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

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

◆ getLinkAnalyzerResult()

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.

Definition at line 295 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

Returns
‪int UID of the start page for this task

Definition at line 160 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 345 of file ValidatorTask.php.

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

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

◆ loadModTSconfig()

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

Load and merge linkvalidator TSconfig from task configuration with page TSconfig

Definition at line 320 of file ValidatorTask.php.

References TYPO3\CMS\Core\Utility\MailUtility\getSystemFromAddress(), and TYPO3\CMS\Core\Utility\MailUtility\getSystemFromName().

◆ setCliArguments()

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

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

Definition at line 476 of file ValidatorTask.php.

References $_SERVER.

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

◆ setConfiguration()

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

Set the value of the private property configuration

Parameters
string$configuration‪specific TSconfig for this task

Definition at line 254 of file ValidatorTask.php.

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

◆ setDepth()

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

Definition at line 212 of file ValidatorTask.php.

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

◆ setEmail()

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

Definition at line 128 of file ValidatorTask.php.

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

◆ setEmailOnBrokenLinkOnly()

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

Definition at line 149 of file ValidatorTask.php.

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

◆ setEmailTemplateName()

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

Definition at line 233 of file ValidatorTask.php.

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

◆ setLanguages()

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

Set the value of the private property languages

Parameters
string$languages‪Languages to fetch broken links

Definition at line 191 of file ValidatorTask.php.

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

◆ setPage()

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.

Definition at line 170 of file ValidatorTask.php.

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

◆ templateFilesExist()

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

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

Definition at line 524 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 54 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 88 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 82 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 50 of file ValidatorTask.php.

◆ $sleepTime

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

Definition at line 46 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 385 of file ValidatorTask.php.

◆ true

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

Definition at line 444 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(MailerInterface::class)->send(‪$fluidEmail)

Definition at line 437 of file ValidatorTask.php.

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