TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ValidatorTask Class Reference
Inheritance diagram for ValidatorTask:
AbstractTask

Public Member Functions

 getEmail ()
 
 setEmail ($email)
 
 getEmailOnBrokenLinkOnly ()
 
 setEmailOnBrokenLinkOnly ($emailOnBrokenLinkOnly)
 
 getPage ()
 
 setPage ($page)
 
 getDepth ()
 
 setDepth ($depth)
 
 getEmailTemplateFile ()
 
 setEmailTemplateFile ($emailTemplateFile)
 
 getConfiguration ()
 
 setConfiguration ($configuration)
 
 execute ()
 
 getAdditionalInformation ()
 
- Public Member Functions inherited from AbstractTask
 __construct ()
 
 execute ()
 
 getAdditionalInformation ()
 
 setTaskUid ($id)
 
 getTaskUid ()
 
 getTaskTitle ()
 
 getTaskDescription ()
 
 getTaskClassName ()
 
 isDisabled ()
 
 setDisabled ($flag)
 
 setExecutionTime ($timestamp)
 
 getTaskGroup ()
 
 setTaskGroup ($taskGroup)
 
 getExecutionTime ()
 
 setDescription ($description)
 
 getDescription ()
 
 setScheduler ()
 
 unsetScheduler ()
 
 setExecution (\TYPO3\CMS\Scheduler\Execution $execution)
 
 getExecution ()
 
 getNextDueExecution ()
 
 areMultipleExecutionsAllowed ()
 
 isExecutionRunning ()
 
 markExecution ()
 
 unmarkExecution ($executionID,\Exception $failure=null)
 
 unmarkAllExecutions ()
 
 save ()
 
 stop ()
 
 remove ()
 

Protected Member Functions

 loadModTsConfig ($page)
 
 getSearchField (array $modTS)
 
 getLinkTypes (array $modTS)
 
 buildMail ($curPage, $pageList, array $markerArray, array $oldBrokenLink)
 
 setCliArguments ()
 
 getLanguageService ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $sleepTime
 
 $sleepAfterFinish
 
 $countInARun
 
 $totalBrokenLink = 0
 
 $oldTotalBrokenLink = 0
 
 $templateMail
 
 $configuration = array()
 
 $isDifferentToLastRun
 
 $emailTemplateFile
 
 $depth
 
 $page
 
 $email
 
 $emailOnBrokenLinkOnly
 
 $templateService
 
- Protected Attributes inherited from AbstractTask
 $scheduler
 
 $taskUid
 
 $disabled = false
 
 $execution
 
 $executionTime = 0
 
 $description = ''
 
 $taskGroup
 

Detailed Description

This class provides Scheduler plugin implementation

Definition at line 30 of file ValidatorTask.php.

Member Function Documentation

buildMail (   $curPage,
  $pageList,
array  $markerArray,
array  $oldBrokenLink 
)
protected

Build the mail content

Parameters
int$curPageId of the current page
string$pageListList of pages id
array$markerArrayArray of markers
array$oldBrokenLinkMarker array with the number of link found
Returns
string Content of the mail

Definition at line 509 of file ValidatorTask.php.

References $GLOBALS, GeneralUtility\callUserFunction(), BackendUtility\getRecord(), and BackendUtility\getRecordTitle().

execute ( )

Function execute from the Scheduler

Returns
bool TRUE on successful execution, FALSE on error
Exceptions
\InvalidArgumentExceptionif the email template file can not be read

Definition at line 254 of file ValidatorTask.php.

References ValidatorTask\$page, GeneralUtility\getFileAbsFileName(), ValidatorTask\getLanguageService(), ValidatorTask\loadModTsConfig(), GeneralUtility\makeInstance(), AbstractTask\save(), ValidatorTask\setCliArguments(), and GeneralUtility\trimExplode().

getAdditionalInformation ( )

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

Returns
string

Definition at line 557 of file ValidatorTask.php.

References ValidatorTask\$depth, $lang, ValidatorTask\$page, ValidatorTask\getDepth(), ValidatorTask\getEmail(), ValidatorTask\getLanguageService(), ValidatorTask\getPage(), BackendUtility\getRecord(), and BackendUtility\getRecordTitle().

getConfiguration ( )

Get the value of the protected property configuration

Returns
array specific TSconfig for this task

Definition at line 232 of file ValidatorTask.php.

References ValidatorTask\$configuration.

getDatabaseConnection ( )
protected
Returns

Definition at line 613 of file ValidatorTask.php.

References $GLOBALS.

getDepth ( )

Get the value of the protected property depth

Returns
int Level of pages the task should check

Definition at line 190 of file ValidatorTask.php.

References ValidatorTask\$depth.

Referenced by ValidatorTask\getAdditionalInformation().

getEmail ( )

Get the value of the protected property email

Returns
string Email address to which an email report is sent

Definition at line 127 of file ValidatorTask.php.

References ValidatorTask\$email.

Referenced by ValidatorTask\getAdditionalInformation().

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 148 of file ValidatorTask.php.

References ValidatorTask\$emailOnBrokenLinkOnly.

getEmailTemplateFile ( )

Get the value of the protected property emailTemplateFile

Returns
string Template to be used for the email

Definition at line 211 of file ValidatorTask.php.

References ValidatorTask\$emailTemplateFile.

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 605 of file ValidatorTask.php.

References $GLOBALS.

Referenced by ValidatorTask\execute(), ValidatorTask\getAdditionalInformation(), and ValidatorTask\loadModTsConfig().

getLinkTypes ( array  $modTS)
protected

Get the list of linkTypes to parse in modTSconfig

Parameters
array$modTSmod.linkvalidator TSconfig array
Returns
array $linkTypes list of link types

Definition at line 399 of file ValidatorTask.php.

References $GLOBALS, and GeneralUtility\trimExplode().

getPage ( )

Get the value of the protected property page

Returns
int UID of the start page for this task

Definition at line 169 of file ValidatorTask.php.

References ValidatorTask\$page.

Referenced by ValidatorTask\getAdditionalInformation().

getSearchField ( array  $modTS)
protected

Get the list of fields to parse in modTSconfig

Parameters
array$modTSmod.linkvalidator TSconfig array
Returns
array $searchFields List of fields

Definition at line 381 of file ValidatorTask.php.

References GeneralUtility\trimExplode().

loadModTsConfig (   $page)
protected

Get the linkvalidator modTSconfig for a page

Parameters
int$pageUid of the page
Returns
array $modTsConfig mod.linkvalidator TSconfig array
Exceptions
\Exception

Definition at line 348 of file ValidatorTask.php.

References ValidatorTask\$page, GeneralUtility\deprecationLog(), ValidatorTask\getLanguageService(), BackendUtility\getModTSconfig(), GeneralUtility\makeInstance(), and ArrayUtility\mergeRecursiveWithOverrule().

Referenced by ValidatorTask\execute().

setCliArguments ( )
protected

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

Returns
void

Definition at line 586 of file ValidatorTask.php.

Referenced by ValidatorTask\execute().

setConfiguration (   $configuration)

Set the value of the private property configuration

Parameters
array$configurationspecific TSconfig for this task
Returns
void

Definition at line 243 of file ValidatorTask.php.

References ValidatorTask\$configuration.

setDepth (   $depth)

Set the value of the private property depth

Parameters
int$depthLevel of pages the task should check
Returns
void

Definition at line 201 of file ValidatorTask.php.

References ValidatorTask\$depth.

setEmail (   $email)

Set the value of the private property email.

Parameters
string$emailEmail address to which an email report is sent
Returns
void

Definition at line 138 of file ValidatorTask.php.

References ValidatorTask\$email.

setEmailOnBrokenLinkOnly (   $emailOnBrokenLinkOnly)

Set the value of the private property emailOnBrokenLinkOnly

Parameters
bool$emailOnBrokenLinkOnlyOnly send an email, if new broken links were found
Returns
void

Definition at line 159 of file ValidatorTask.php.

References ValidatorTask\$emailOnBrokenLinkOnly.

setEmailTemplateFile (   $emailTemplateFile)

Set the value of the private property emailTemplateFile

Parameters
string$emailTemplateFileTemplate to be used for the email
Returns
void

Definition at line 222 of file ValidatorTask.php.

References ValidatorTask\$emailTemplateFile.

setPage (   $page)

Set the value of the private property page

Parameters
int$pageUID of the start page for this task.
Returns
void

Definition at line 180 of file ValidatorTask.php.

References ValidatorTask\$page.

Member Data Documentation

$configuration = array()
protected
$countInARun
protected

Definition at line 45 of file ValidatorTask.php.

$depth
protected
$email
protected

Definition at line 108 of file ValidatorTask.php.

Referenced by ValidatorTask\getEmail(), and ValidatorTask\setEmail().

$emailOnBrokenLinkOnly
protected
$emailTemplateFile
protected
$isDifferentToLastRun
protected

Definition at line 80 of file ValidatorTask.php.

$oldTotalBrokenLink = 0
protected

Definition at line 59 of file ValidatorTask.php.

$page
protected
$sleepAfterFinish
protected

Definition at line 40 of file ValidatorTask.php.

$sleepTime
protected

Definition at line 35 of file ValidatorTask.php.

$templateMail
protected

Definition at line 66 of file ValidatorTask.php.

$templateService
protected

Definition at line 120 of file ValidatorTask.php.

$totalBrokenLink = 0
protected

Definition at line 52 of file ValidatorTask.php.