ValidatorTask extends AbstractTask

This class provides Scheduler plugin implementation

Internal

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

Table of Contents

Constants

TYPE_RECURRING  = 2
TYPE_SINGLE  = 1

Properties

$configuration  : string
Specific TSconfig for this task.
$countInARun  : int
$depth  : int
Level of pages the task should check
$description  : string
Description for the task
$disabled  : bool
Disable flag, TRUE if task is disabled, FALSE otherwise
$email  : string
Email address to which an email report is sent
$emailOnBrokenLinkOnly  : bool
Only send an email, if new broken links were found
$emailTemplateName  : string
Template name to be used for the email
$execution  : Execution
The execution object related to the task
$executionTime  : int
This variable contains the time of next execution of the task
$languageFile  : string
Default language file of the extension linkvalidator
$languages  : string
Languages to check for broken links
$modTSconfig  : array<string|int, mixed>
Merged mod TSconfig
$page  : int
UID of the start page for this task
$runOnNextCronJob  : bool
Run on next cron job flag, TRUE if task should run on next cronjob, FALSE otherwise
$sleepAfterFinish  : int
$sleepTime  : int
$taskGroup  : int|null
Task group for this task
$taskNeedsUpdate  : bool
Defines if the task should be updated as some values have changed during task execution
$taskUid  : int
The unique id of the task used to identify it in the database.

Methods

__construct()  : mixed
execute()  : bool
Function execute from the Scheduler
getAdditionalInformation()  : string
Returns the most important properties of the LinkValidator task as a comma separated string that will be displayed in the scheduler module.
getConfiguration()  : string
Get the value of the protected property configuration
getDepth()  : int
Get the value of the protected property depth
getDescription()  : string
This method returns the description of the task
getEmail()  : string
Get the value of the protected property email
getEmailOnBrokenLinkOnly()  : bool
Get the value of the protected property emailOnBrokenLinkOnly
getEmailTemplateName()  : string
Get the value of the protected property emailTemplateName
getExecution()  : Execution|object|null
Returns the execution object
getExecutionTime()  : int
This method returns the timestamp corresponding to the next execution time of the task
getLanguages()  : string
Get the value of the protected property languages
getPage()  : int
Get the value of the protected property page
getRunOnNextCronJob()  : bool
This method returns the run on next cron job status of the task
getTaskClassName()  : string
This method returns the class name of the scheduler task Unused since TYPO3 v14.0, can be deprecated and removed once we migrate task registration away from TYPO3_CONF_VARS.
getTaskDescription()  : string
This method returns the description of the scheduler task
getTaskGroup()  : int|null
This method returns the task group (uid) of the task
getTaskParameters()  : array<string|int, mixed>
It is recommended to implement this method in the respective task class.
getTaskTitle()  : string
This method returns the title of the scheduler task
getTaskType()  : string
getTaskUid()  : int
This method returns the unique id of the task
getType()  : int
Guess recurring type from the existing information If an interval or a cron command is defined, it's a recurring task
isDisabled()  : bool
This method returns the disabled status of the task
setConfiguration()  : self
Set the value of the private property configuration
setDepth()  : self
Set the value of the private property depth
setDescription()  : void
This method is used to set the description of the task
setDisabled()  : mixed
This method is used to set the disabled status of the task
setEmail()  : self
Set the value of the private property email.
setEmailOnBrokenLinkOnly()  : self
Set the value of the private property emailOnBrokenLinkOnly
setEmailTemplateName()  : self
Set the value of the private property emailTemplateName
setExecution()  : void
Sets the internal execution object
setExecutionTime()  : mixed
This method is used to set the timestamp corresponding to the next execution time of the task
setLanguages()  : self
Set the value of the private property languages
setPage()  : self
Set the value of the private property page
setRunOnNextCronJob()  : mixed
This method set the flag for next cron job execution
setTaskGroup()  : mixed
This method is used to set the task group (uid) of the task
setTaskParameters()  : void
setTaskUid()  : void
This method is used to set the unique id of the task
getFluidEmail()  : FluidEmail
Get FluidEmail with template from the task configuration
getLanguageService()  : LanguageService|null
getLinkAnalyzerResult()  : LinkAnalyzerResult
Validate all broken links for pages set in the task configuration and return the analyzers result as object.
getLinkTypes()  : array<int, string>
Get the list of linkTypes to consider for fetching broken links
getSearchField()  : array<string|int, mixed>
Get the list of fields to consider for fetching broken links
loadModTSconfig()  : void
Load and merge linkvalidator TSconfig from task configuration with page TSconfig
logException()  : mixed
reportEmail()  : bool
Build and send report email when broken links were found
setCliArguments()  : self
Simulate cli call with setting the required options to the $_SERVER['argv']
templateFilesExist()  : bool
Check if both template files (html and txt) exist under at least one template path

Constants

TYPE_RECURRING

public mixed TYPE_RECURRING = 2

Properties

$configuration

Specific TSconfig for this task.

protected string $configuration = ''

$depth

Level of pages the task should check

protected int $depth = 0

$description

Description for the task

protected string $description = ''

$disabled

Disable flag, TRUE if task is disabled, FALSE otherwise

protected bool $disabled = false

$email

Email address to which an email report is sent

protected string $email = ''

$emailOnBrokenLinkOnly

Only send an email, if new broken links were found

protected bool $emailOnBrokenLinkOnly = true

$emailTemplateName

Template name to be used for the email

protected string $emailTemplateName = ''

$executionTime

This variable contains the time of next execution of the task

protected int $executionTime = 0

$languageFile

Default language file of the extension linkvalidator

protected string $languageFile = 'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf'

$languages

Languages to check for broken links

protected string $languages = ''

$modTSconfig

Merged mod TSconfig

protected array<string|int, mixed> $modTSconfig = []

$page

UID of the start page for this task

protected int $page = 0

$runOnNextCronJob

Run on next cron job flag, TRUE if task should run on next cronjob, FALSE otherwise

protected bool $runOnNextCronJob = false

$sleepAfterFinish

protected int $sleepAfterFinish

$taskGroup

Task group for this task

protected int|null $taskGroup = 0

$taskNeedsUpdate

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

protected bool $taskNeedsUpdate = false

$taskUid

The unique id of the task used to identify it in the database.

protected int $taskUid = 0

Methods

execute()

Function execute from the Scheduler

public execute() : bool
Return values
bool

TRUE on successful execution, FALSE on error

getAdditionalInformation()

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

public getAdditionalInformation() : string
Return values
string

Information to display

getConfiguration()

Get the value of the protected property configuration

public getConfiguration() : string
Return values
string

specific TSconfig for this task

getDepth()

Get the value of the protected property depth

public getDepth() : int
Return values
int

Level of pages the task should check

getDescription()

This method returns the description of the task

public getDescription() : string
Return values
string

Description

getEmail()

Get the value of the protected property email

public getEmail() : string
Return values
string

Email address to which an email report is sent

getEmailOnBrokenLinkOnly()

Get the value of the protected property emailOnBrokenLinkOnly

public getEmailOnBrokenLinkOnly() : bool
Return values
bool

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

getEmailTemplateName()

Get the value of the protected property emailTemplateName

public getEmailTemplateName() : string
Return values
string

Template name to be used for the email

getExecution()

Returns the execution object

public getExecution() : Execution|object|null
Internal

since TYPO3 v12.3, not part of TYPO3 Public API anymore.

Return values
Execution|object|null

The internal execution object - when an invalid task is being unserialized, the Execution object might not be available

getExecutionTime()

This method returns the timestamp corresponding to the next execution time of the task

public getExecutionTime() : int
Return values
int

Timestamp of next execution

getLanguages()

Get the value of the protected property languages

public getLanguages() : string
Return values
string

Languages to fetch broken links

getPage()

Get the value of the protected property page

public getPage() : int
Return values
int

UID of the start page for this task

getRunOnNextCronJob()

This method returns the run on next cron job status of the task

public getRunOnNextCronJob() : bool
Return values
bool

TRUE if task should run on next cron job, FALSE otherwise

getTaskClassName()

This method returns the class name of the scheduler task Unused since TYPO3 v14.0, can be deprecated and removed once we migrate task registration away from TYPO3_CONF_VARS.

public getTaskClassName() : string
Return values
string

getTaskDescription()

This method returns the description of the scheduler task

public getTaskDescription() : string
Return values
string

getTaskGroup()

This method returns the task group (uid) of the task

public getTaskGroup() : int|null
Return values
int|null

Uid of task group or null if it came back from the DB without the task group set.

getTaskParameters()

It is recommended to implement this method in the respective task class.

public getTaskParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTaskTitle()

This method returns the title of the scheduler task

public getTaskTitle() : string
Return values
string

getTaskType()

public getTaskType() : string
Return values
string

getTaskUid()

This method returns the unique id of the task

public getTaskUid() : int
Return values
int

The id of the task

getType()

Guess recurring type from the existing information If an interval or a cron command is defined, it's a recurring task

public getType() : int
Return values
int

isDisabled()

This method returns the disabled status of the task

public isDisabled() : bool
Return values
bool

TRUE if task is disabled, FALSE otherwise

setConfiguration()

Set the value of the private property configuration

public setConfiguration(string $configuration) : self
Parameters
$configuration : string

specific TSconfig for this task

Return values
self

setDepth()

Set the value of the private property depth

public setDepth(int $depth) : self
Parameters
$depth : int

Level of pages the task should check

Return values
self

setDescription()

This method is used to set the description of the task

public setDescription(string $description) : void
Parameters
$description : string

Description

setDisabled()

This method is used to set the disabled status of the task

public setDisabled(bool $flag) : mixed
Parameters
$flag : bool

TRUE if task should be disabled, FALSE otherwise

setEmail()

Set the value of the private property email.

public setEmail(string $email) : self
Parameters
$email : string

Email address to which an email report is sent

Return values
self

setEmailOnBrokenLinkOnly()

Set the value of the private property emailOnBrokenLinkOnly

public setEmailOnBrokenLinkOnly(bool $emailOnBrokenLinkOnly) : self
Parameters
$emailOnBrokenLinkOnly : bool

Only send an email, if new broken links were found

Return values
self

setEmailTemplateName()

Set the value of the private property emailTemplateName

public setEmailTemplateName(string $emailTemplateName) : self
Parameters
$emailTemplateName : string

Template name to be used for the email

Return values
self

setExecution()

Sets the internal execution object

public setExecution(Execution $execution) : void
Parameters
$execution : Execution

The execution to add

Internal

since TYPO3 v12.3, not part of TYPO3 Public API anymore.

setExecutionTime()

This method is used to set the timestamp corresponding to the next execution time of the task

public setExecutionTime(int $timestamp) : mixed
Parameters
$timestamp : int

Timestamp of next execution

setLanguages()

Set the value of the private property languages

public setLanguages(string $languages) : self
Parameters
$languages : string

Languages to fetch broken links

Return values
self

setPage()

Set the value of the private property page

public setPage(int $page) : self
Parameters
$page : int

UID of the start page for this task.

Return values
self

setRunOnNextCronJob()

This method set the flag for next cron job execution

public setRunOnNextCronJob(bool $flag) : mixed
Parameters
$flag : bool

TRUE if task should run with the next cron job, FALSE otherwise

setTaskGroup()

This method is used to set the task group (uid) of the task

public setTaskGroup(int $taskGroup) : mixed
Parameters
$taskGroup : int

Uid of task group

setTaskParameters()

public setTaskParameters(array<string|int, mixed> $parameters) : void
Parameters
$parameters : array<string|int, mixed>

setTaskUid()

This method is used to set the unique id of the task

public setTaskUid(int $id) : void
Parameters
$id : int

Primary key (from the database record) of the scheduled task

getLinkTypes()

Get the list of linkTypes to consider for fetching broken links

protected getLinkTypes() : array<int, string>
Return values
array<int, string>

$linkTypes list of link types

getSearchField()

Get the list of fields to consider for fetching broken links

protected getSearchField() : array<string|int, mixed>
Return values
array<string|int, mixed>

$searchFields List of search fields

loadModTSconfig()

Load and merge linkvalidator TSconfig from task configuration with page TSconfig

protected loadModTSconfig() : void

logException()

protected logException(Exception $e) : mixed
Parameters
$e : Exception

reportEmail()

Build and send report email when broken links were found

protected reportEmail(LinkAnalyzerResult $linkAnalyzerResult) : bool
Parameters
$linkAnalyzerResult : LinkAnalyzerResult
Return values
bool

TRUE if mail was sent, FALSE if not

setCliArguments()

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

protected setCliArguments() : self
Return values
self

templateFilesExist()

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

protected templateFilesExist(array<string|int, mixed> $templatePaths) : bool
Parameters
$templatePaths : array<string|int, mixed>
Return values
bool

        
On this page

Search results