LinkAnalyzer
This class provides Processing plugin implementation
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
- $brokenLinkCounts : array<string|int, mixed>
- Array of tables and the number of broken external links they contain
- $brokenLinkRepository : BrokenLinkRepository
- $eventDispatcher : EventDispatcherInterface
- $linkCounts : array<string|int, mixed>
- Array of tables and the number of external links they contain
- $linktypeRegistry : LinktypeRegistry
- $pids : array<string|int, 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<string|int, mixed>
- 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<string|int, mixed>
- 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<string|int, mixed>
$brokenLinkCounts
= []
$brokenLinkRepository read-only
protected
BrokenLinkRepository
$brokenLinkRepository
$eventDispatcher read-only
protected
EventDispatcherInterface
$eventDispatcher
$linkCounts
Array of tables and the number of external links they contain
protected
array<string|int, mixed>
$linkCounts
= []
$linktypeRegistry read-only
protected
LinktypeRegistry
$linktypeRegistry
$pids
List of page uids (rootline downwards)
protected
array<string|int, int>
$pids
= []
$searchFields
Array of tables and fields to search for broken links
protected
array<string, array<int, string>>
$searchFields
= []
$softReferenceParserFactory read-only
protected
SoftReferenceParserFactory
$softReferenceParserFactory
$tcaSchemaFactory read-only
protected
TcaSchemaFactory
$tcaSchemaFactory
$tsConfig
The currently active TSconfig. Will be passed to the init function.
protected
array<string|int, mixed>
$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<string|int, mixed> &$results, string $table, array<string|int, mixed> $fields, array<string|int, mixed> $record) : mixed
Parameters
- $results : array<string|int, mixed>
-
Array of broken links
- $table : string
-
Table name of the record
- $fields : array<string|int, mixed>
-
Array of fields to analyze
- $record : array<string|int, mixed>
-
Record to analyze
getLinkCounts()
Fill a marker array with the number of links found in a list of pages
public
getLinkCounts() : array<string|int, mixed>
Return values
array<string|int, mixed> —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<string|int, mixed> $searchFields, array<string|int, int> $pidList, array<string|int, mixed> $tsConfig) : mixed
Parameters
- $searchFields : array<string|int, mixed>
-
List of fields in which to search for links
- $pidList : array<string|int, int>
-
List of page uids in which to search for links
- $tsConfig : array<string|int, mixed>
-
The currently active TSconfig.
recheckLinks()
Recheck for broken links for one field in table for record.
public
recheckLinks(array<string|int, mixed> $checkOptions, string|int $recordUid, string $table, string $field, int $timestamp[, bool $considerHidden = true ]) : void
Parameters
- $checkOptions : array<string|int, mixed>
- $recordUid : string|int
-
uid of record to check
- $table : string
- $field : string
- $timestamp : int
-
- only recheck if timestamp changed
- $considerHidden : bool = true
analyzeLinks()
Find all supported broken links for a specific link list
protected
analyzeLinks(SoftReferenceParserResult $parserResult, array<string|int, mixed> &$results, array<string|int, mixed> $record, string $field, string $table) : mixed
Parameters
- $parserResult : SoftReferenceParserResult
-
findRef parsed records
- $results : array<string|int, mixed>
-
Array of broken links
- $record : array<string|int, mixed>
-
UID of the current record
- $field : string
-
The current field
- $table : string
-
The current table
analyzeTypoLinks()
Find all supported broken links for a specific typoLink
protected
analyzeTypoLinks(SoftReferenceParserResult $parserResult, array<string|int, mixed> &$results, HtmlParser $htmlParser, array<string|int, mixed> $record, string $field, string $table) : mixed
Parameters
- $parserResult : SoftReferenceParserResult
-
findRef parsed records
- $results : array<string|int, mixed>
-
Array of broken links
- $htmlParser : HtmlParser
-
Instance of html parser
- $record : array<string|int, mixed>
-
The current record
- $field : string
-
The current field
- $table : string
-
The current table
checkLinks()
protected
checkLinks(array<string|int, mixed> $links, array<int, string> $linkTypes) : mixed
Parameters
- $links : array<string|int, mixed>
- $linkTypes : array<int, string>
getLanguageService()
protected
getLanguageService() : LanguageService