LinkAnalyzer

class \TYPO3\CMS\Linkvalidator\LinkAnalyzer

This class provides Processing plugin implementation

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Properties

$brokenLinkCounts  : array
Array of tables and the number of broken external links they contain
$brokenLinkRepository  : BrokenLinkRepository
$eventDispatcher  : EventDispatcherInterface
$linkCounts  : array
Array of tables and the number of external links they contain
$linktypeRegistry  : LinktypeRegistry
$pids  : int[]
List of page uids (rootline downwards)
$searchFields  : array<string, array<int, string>>
Array of tables and fields to search for broken links
$softReferenceParserFactory  : SoftReferenceParserFactory
$tcaSchemaFactory  : TcaSchemaFactory
$tsConfig  : array
The currently active TSconfig. Will be passed to the init function.

Methods

__construct()  : mixed
analyzeRecord()  : mixed
Find all supported broken links for a specific record
getLinkCounts()  : array
Fill a marker array with the number of links found in a list of pages
getLinkStatistics()  : mixed
Find all supported broken links and store them in tx_linkvalidator_link
init()  : mixed
Store all the needed configuration values in class variables
recheckLinks()  : void
Recheck for broken links for one field in table for record.
analyzeLinks()  : mixed
Find all supported broken links for a specific link list
analyzeTypoLinks()  : mixed
Find all supported broken links for a specific typoLink
checkLinks()  : mixed
getLanguageService()  : LanguageService

Properties

$brokenLinkCounts

Array of tables and the number of broken external links they contain

protected array $brokenLinkCounts = []

$eventDispatcher read-only

protected EventDispatcherInterface $eventDispatcher

$linkCounts

Array of tables and the number of external links they contain

protected array $linkCounts = []

$pids

List of page uids (rootline downwards)

protected int[] $pids = []

$searchFields

Array of tables and fields to search for broken links

protected array<string, array<int, string>> $searchFields = []

$tsConfig

The currently active TSconfig. Will be passed to the init function.

protected array $tsConfig = []

Methods

__construct()

public __construct(EventDispatcherInterface $eventDispatcher, BrokenLinkRepository $brokenLinkRepository, SoftReferenceParserFactory $softReferenceParserFactory, LinktypeRegistry $linktypeRegistry, TcaSchemaFactory $tcaSchemaFactory) : mixed

Parameters

$eventDispatcher : EventDispatcherInterface
$brokenLinkRepository : BrokenLinkRepository
$softReferenceParserFactory : SoftReferenceParserFactory
$linktypeRegistry : LinktypeRegistry
$tcaSchemaFactory : TcaSchemaFactory

analyzeRecord()

Find all supported broken links for a specific record

public analyzeRecord(array &$results, string $table, array $fields, array $record) : mixed

Parameters

$results : array

Array of broken links

$table : string

Table name of the record

$fields : array

Array of fields to analyze

$record : array

Record to analyze

getLinkCounts()

Fill a marker array with the number of links found in a list of pages

public getLinkCounts() : array

Return values

array —

array with the number of links found

getLinkStatistics()

Find all supported broken links and store them in tx_linkvalidator_link

public getLinkStatistics([array<int, string> $linkTypes = [] ][, bool $considerHidden = false ]) : mixed

Parameters

$linkTypes : array<int, string> = []

List of hook object to activate

$considerHidden : bool = false

Defines whether to look into hidden fields

init()

Store all the needed configuration values in class variables

public init(array $searchFields, int[] $pidList, array $tsConfig) : mixed

Parameters

$searchFields : array

List of fields in which to search for links

$pidList : int[]

List of page uids in which to search for links

$tsConfig : array

The currently active TSconfig.

Recheck for broken links for one field in table for record.

public recheckLinks(array $checkOptions, string|int $recordUid, string $table, string $field, int $timestamp[, bool $considerHidden = true ]) : void

Parameters

$checkOptions : array
$recordUid : string|int

uid of record to check

$table : string
$field : string
$timestamp : int
  • only recheck if timestamp changed
$considerHidden : bool = true

Find all supported broken links for a specific link list

protected analyzeLinks(SoftReferenceParserResult $parserResult, array &$results, array $record, string $field, string $table) : mixed

Parameters

$parserResult : SoftReferenceParserResult

findRef parsed records

$results : array

Array of broken links

$record : array

UID of the current record

$field : string

The current field

$table : string

The current table

Find all supported broken links for a specific typoLink

protected analyzeTypoLinks(SoftReferenceParserResult $parserResult, array &$results, HtmlParser $htmlParser, array $record, string $field, string $table) : mixed

Parameters

$parserResult : SoftReferenceParserResult

findRef parsed records

$results : array

Array of broken links

$htmlParser : HtmlParser

Instance of html parser

$record : array

The current record

$field : string

The current field

$table : string

The current table

protected checkLinks(array $links, array<int, string> $linkTypes) : mixed

Parameters

$links : array
$linkTypes : array<int, string>
On this page