‪TYPO3CMS  9.5
TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype Class Reference
Inheritance diagram for TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype:
TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype TYPO3\CMS\Linkvalidator\Linktype\LinktypeInterface

Public Member Functions

 __construct (RequestFactory $requestFactory=null)
 
bool checkLink ($origUrl, $softRefEntry, $reference)
 
string getErrorMessage ($errorParams)
 
string fetchType ($value, $type, $key)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype
array getErrorParams ()
 
string getBrokenUrl ($row)
 

Protected Member Functions

bool requestUrl (string $url, string $method, array $options)
 
string preprocessUrl (string $url)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype
 setErrorParams ($value)
 
LanguageService getLanguageService ()
 

Protected Attributes

array $urlReports = array( )
 
array $urlErrorParams = array( )
 
array $headers
 
RequestFactory $requestFactory
 
array $errorParams = array( )
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype
array $errorParams = array( )
 

Detailed Description

This class provides Check External Links plugin implementation

Definition at line 25 of file ExternalLinktype.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::__construct ( RequestFactory  $requestFactory = null)

Member Function Documentation

◆ checkLink()

bool TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::checkLink (   $origUrl,
  $softRefEntry,
  $reference 
)

Checks a given URL for validity

Parameters
string$origUrl‪The URL to check
array$softRefEntry‪The soft reference entry which builds the context of that URL
\TYPO3\CMS\Linkvalidator\LinkAnalyzer$reference‪Parent instance
Returns
‪bool TRUE on success or FALSE on error
Exceptions

Implements TYPO3\CMS\Linkvalidator\Linktype\LinktypeInterface.

Definition at line 72 of file ExternalLinktype.php.

References TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\$errorParams, TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\$headers, TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\preprocessUrl(), TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\requestUrl(), and TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\setErrorParams().

◆ fetchType()

string TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::fetchType (   $value,
  $type,
  $key 
)

Get the external type from the softRefParserObj result

Parameters
array$value‪Reference properties
string$type‪Current type
string$key‪Validator hook name
Returns
‪string Fetched type

Reimplemented from TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype.

Definition at line 200 of file ExternalLinktype.php.

◆ getErrorMessage()

string TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::getErrorMessage (   $errorParams)

Generate the localized error message from the error params saved from the parsing

Parameters
array$errorParams‪All parameters needed for the rendering of the error message
Returns
‪string Validation error message

Implements TYPO3\CMS\Linkvalidator\Linktype\LinktypeInterface.

Definition at line 152 of file ExternalLinktype.php.

References TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\$errorParams, and TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\getLanguageService().

Referenced by TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\requestUrl().

◆ preprocessUrl()

string TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::preprocessUrl ( string  $url)
protected

Convert given URL to punycode to handle domains with non-ASCII characters

Parameters
string$url
Returns
‪string

Definition at line 215 of file ExternalLinktype.php.

References TYPO3\CMS\Core\Utility\HttpUtility\buildUrl(), and TYPO3\CMS\Core\Utility\HttpUtility\idn_to_ascii().

Referenced by TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\checkLink().

◆ requestUrl()

bool TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::requestUrl ( string  $url,
string  $method,
array  $options 
)
protected

Check URL using the specified request methods

Parameters
string$url
string$method
array$options
Returns
‪bool

Definition at line 107 of file ExternalLinktype.php.

References TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\getErrorMessage().

Referenced by TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\checkLink().

Member Data Documentation

◆ $errorParams

array TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::$errorParams = array( )
protected

◆ $headers

array TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::$headers
protected
Initial value:
= array(
'User-Agent' => 'TYPO3 linkvalidator',
'Accept' => '*/*',
'Accept-Language' => '*',
'Accept-Encoding' => '*',
)

List of HTTP request headers to use for checking a URL

Definition at line 43 of file ExternalLinktype.php.

Referenced by TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype\checkLink().

◆ $requestFactory

RequestFactory TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::$requestFactory
protected

◆ $urlErrorParams

array TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::$urlErrorParams = array( )
protected

Cached list of all error parameters of the URLs, which were already checked for the current processing

Definition at line 37 of file ExternalLinktype.php.

◆ $urlReports

array TYPO3\CMS\Linkvalidator\Linktype\ExternalLinktype::$urlReports = array( )
protected

Cached list of the URLs, which were already checked for the current processing

Definition at line 31 of file ExternalLinktype.php.