‪TYPO3CMS  10.4
TYPO3\CMS\Linkvalidator\LinkAnalyzer Class Reference

Public Member Functions

 init (array $searchFields, $pidList, $tsConfig)
 
 getLinkStatistics ($checkOptions=[], $considerHidden=false)
 
 recheckLinks (array $checkOptions, string $recordUid, string $table, string $field, int $timestamp, bool $considerHidden=true)
 
 analyzeRecord (array &$results, $table, array $fields, array $record)
 
array getTSConfig ()
 
array getLinkCounts ()
 
string extGetTreeList ($id, $depth, $begin, $permsClause, $considerHidden=false)
 
bool getRootLineIsHidden (array $pageInfo)
 

Public Attributes

$this brokenLinkRepository = $brokenLinkRepository
 

Protected Member Functions

 checkLinks (array $links, array $checkOptions)
 
 analyzeLinks (array $resultArray, array &$results, array $record, $field, $table)
 
 analyzeTypoLinks (array $resultArray, array &$results, $htmlParser, array $record, $field, $table)
 
LanguageService getLanguageService ()
 

Protected Attributes

array< string, $searchFields=array();protected array $pids=array();protected array $linkCounts=array();protected array $brokenLinkCounts=array();protected Linktype\AbstractLinktype[] $hookObjectsArr=array();protected string $recordReference='';protected array $tsConfig=array();protected EventDispatcherInterface $eventDispatcher;protected BrokenLinkRepository $brokenLinkRepository;public function __construct(EventDispatcherInterface $eventDispatcher, BrokenLinkRepository $brokenLinkRepository) { $this-> eventDispatcher = $eventDispatcher
 

Detailed Description

This class provides Processing plugin implementation

Definition at line 36 of file LinkAnalyzer.php.

Member Function Documentation

◆ analyzeLinks()

TYPO3\CMS\Linkvalidator\LinkAnalyzer::analyzeLinks ( array  $resultArray,
array &  $results,
array  $record,
  $field,
  $table 
)
protected

Find all supported broken links for a specific link list

Parameters
array$resultArray‪findRef parsed records
array$results‪Array of broken links
array$record‪UID of the current record
string$field‪The current field
string$table‪The current table

Definition at line 382 of file LinkAnalyzer.php.

Referenced by TYPO3\CMS\Linkvalidator\LinkAnalyzer\analyzeRecord().

◆ analyzeRecord()

TYPO3\CMS\Linkvalidator\LinkAnalyzer::analyzeRecord ( array &  $results,
  $table,
array  $fields,
array  $record 
)

Find all supported broken links for a specific record

Parameters
array$results‪Array of broken links
string$table‪Table name of the record
array$fields‪Array of fields to analyze
array$record‪Record to analyze

Definition at line 302 of file LinkAnalyzer.php.

References $fields, $GLOBALS, TYPO3\CMS\Linkvalidator\LinkAnalyzer\analyzeLinks(), TYPO3\CMS\Linkvalidator\LinkAnalyzer\analyzeTypoLinks(), TYPO3\CMS\Linkvalidator\LinkAnalyzer\eventDispatcher, TYPO3\CMS\Backend\Utility\BackendUtility\explodeSoftRefParserList(), and TYPO3\CMS\Backend\Utility\BackendUtility\softRefParserObj().

Referenced by TYPO3\CMS\Linkvalidator\LinkAnalyzer\getLinkStatistics(), and TYPO3\CMS\Linkvalidator\LinkAnalyzer\recheckLinks().

◆ analyzeTypoLinks()

TYPO3\CMS\Linkvalidator\LinkAnalyzer::analyzeTypoLinks ( array  $resultArray,
array &  $results,
  $htmlParser,
array  $record,
  $field,
  $table 
)
protected

Find all supported broken links for a specific typoLink

Parameters
array$resultArray‪findRef parsed records
array$results‪Array of broken links
HtmlParser$htmlParser‪Instance of html parser
array$record‪The current record
string$field‪The current field
string$table‪The current table

Definition at line 419 of file LinkAnalyzer.php.

Referenced by TYPO3\CMS\Linkvalidator\LinkAnalyzer\analyzeRecord().

◆ checkLinks()

TYPO3\CMS\Linkvalidator\LinkAnalyzer::checkLinks ( array  $links,
array  $checkOptions 
)
protected

◆ extGetTreeList()

string TYPO3\CMS\Linkvalidator\LinkAnalyzer::extGetTreeList (   $id,
  $depth,
  $begin,
  $permsClause,
  $considerHidden = false 
)

Calls TYPO3\CMS\Backend\FrontendBackendUserAuthentication::extGetTreeList. Although this duplicates the function TYPO3\CMS\Backend\FrontendBackendUserAuthentication::extGetTreeList this is necessary to create the object that is used recursively by the original function.

Generates a list of page uids from $id. List does not include $id itself. The only pages excluded from the list are deleted pages.

Parameters
int$id‪Start page id
int$depth‪Depth to traverse down the page tree.
int$begin‪is an optional integer that determines at which level to start. use "0" from outside usage
string$permsClause‪Perms clause
bool$considerHidden‪Whether to consider hidden pages or not
Returns
‪string Returns the list with a comma in the end (if any pages selected!)

Definition at line 494 of file LinkAnalyzer.php.

References TYPO3\CMS\Core\Database\Query\QueryHelper\stripLogicalOperatorPrefix().

◆ getLanguageService()

LanguageService TYPO3\CMS\Linkvalidator\LinkAnalyzer::getLanguageService ( )
protected
Returns
‪LanguageService

Definition at line 578 of file LinkAnalyzer.php.

References $GLOBALS.

◆ getLinkCounts()

array TYPO3\CMS\Linkvalidator\LinkAnalyzer::getLinkCounts ( )

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

Returns
‪array array with the number of links found

Definition at line 474 of file LinkAnalyzer.php.

References TYPO3\CMS\Linkvalidator\LinkAnalyzer\brokenLinkRepository.

◆ getLinkStatistics()

TYPO3\CMS\Linkvalidator\LinkAnalyzer::getLinkStatistics (   $checkOptions = [],
  $considerHidden = false 
)

Find all supported broken links and store them in tx_linkvalidator_link

Parameters
array$checkOptions‪List of hook object to activate
bool$considerHidden‪Defines whether to look into hidden fields

Definition at line 124 of file LinkAnalyzer.php.

References $fields, $GLOBALS, TYPO3\CMS\Linkvalidator\LinkAnalyzer\analyzeRecord(), TYPO3\CMS\Linkvalidator\LinkAnalyzer\brokenLinkRepository, and TYPO3\CMS\Linkvalidator\LinkAnalyzer\checkLinks().

◆ getRootLineIsHidden()

bool TYPO3\CMS\Linkvalidator\LinkAnalyzer::getRootLineIsHidden ( array  $pageInfo)

Check if rootline contains a hidden page

Parameters
array$pageInfo‪Array with uid, title, hidden, extendToSubpages from pages table
Returns
‪bool TRUE if rootline contains a hidden page, FALSE if not

Definition at line 544 of file LinkAnalyzer.php.

◆ getTSConfig()

array TYPO3\CMS\Linkvalidator\LinkAnalyzer::getTSConfig ( )

Returns the TSconfig that was passed to the init() method.

This can be used by link checkers that get a reference of this object passed to the checkLink() method.

Returns
‪array

Definition at line 368 of file LinkAnalyzer.php.

◆ init()

TYPO3\CMS\Linkvalidator\LinkAnalyzer::init ( array  $searchFields,
  $pidList,
  $tsConfig 
)

Store all the needed configuration values in class variables

Parameters
array$searchFields‪List of fields in which to search for links
string | array$pidList‪List of comma separated page uids in which to search for links, can be an array too
array$tsConfig‪The currently active TSconfig.

Definition at line 103 of file LinkAnalyzer.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

◆ recheckLinks()

TYPO3\CMS\Linkvalidator\LinkAnalyzer::recheckLinks ( array  $checkOptions,
string  $recordUid,
string  $table,
string  $field,
int  $timestamp,
bool  $considerHidden = true 
)

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

Parameters
array$checkOptions
string$recordUid‪uid of record to check
string$table
string$field
int$timestamp‪- only recheck if timestamp changed
bool$considerHidden

Definition at line 243 of file LinkAnalyzer.php.

References $GLOBALS, TYPO3\CMS\Linkvalidator\LinkAnalyzer\analyzeRecord(), TYPO3\CMS\Linkvalidator\LinkAnalyzer\brokenLinkRepository, TYPO3\CMS\Linkvalidator\LinkAnalyzer\checkLinks(), and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

Member Data Documentation

◆ brokenLinkRepository

◆ eventDispatcher

array<string, $searchFields = array( ); protected array $pids = array( ); protected array $linkCounts = array( ); protected array $brokenLinkCounts = array( ); protected Linktype\AbstractLinktype[] $hookObjectsArr = array( ); protected string $recordReference = ''; protected array $tsConfig = array( ); protected EventDispatcherInterface $eventDispatcher; protected BrokenLinkRepository $brokenLinkRepository; public function __construct(EventDispatcherInterface $eventDispatcher, BrokenLinkRepository $brokenLinkRepository) { $this-> TYPO3\CMS\Linkvalidator\LinkAnalyzer::eventDispatcher = $eventDispatcher
protected

Array of tables and fields to search for broken links

array<int, string>>

Definition at line 91 of file LinkAnalyzer.php.

Referenced by TYPO3\CMS\Linkvalidator\LinkAnalyzer\analyzeRecord().