Detailed Description

LinkProcessor is used to process links in Node instances.

This is used to convert internal application links or relocating relative links when displaying the Node content on a website. LinkProcessor uses a LinkProcessorStrategy for application specific link checking and conversion.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 29 of file LinkProcessor.php.

Static Public Member Functions

static processLinks ($node, $base, LinkProcessorStrategy $strategy, $recursive=true)
 

Static Protected Member Functions

static replaceUrl ($value, $url, $urlConv, $type)
 
static checkUrl ($url, LinkProcessorStrategy $strategy)
 
static convertInternalLink ($url, LinkProcessorStrategy $strategy)
 

Member Function Documentation

◆ processLinks()

static processLinks (   $node,
  $base,
LinkProcessorStrategy  $strategy,
  $recursive = true 
)
static

Check and convert links in the given node.

Parameters
$nodeNode instance
$baseThe base url of relative links as seen from the executing script
$strategyThe strategy used to check and create urls
recursiveBoolean whether to process child nodes to (default: true)
Returns
Array of invalid urls

Definition at line 39 of file LinkProcessor.php.

◆ replaceUrl()

static replaceUrl (   $value,
  $url,
  $urlConv,
  $type 
)
staticprotected

Replace the url in the given value.

Parameters
$value
$url
$urlConv
$typeembedded or direct
Returns
String

Definition at line 116 of file LinkProcessor.php.

◆ checkUrl()

static checkUrl (   $url,
LinkProcessorStrategy  $strategy 
)
staticprotected

Check if an url is reachable (e.g.

if an internal url is broken due to the target set offline).

Parameters
$urlThe url to check
$strategyThe strategy used to check and create urls
Returns
Boolean whether the url is valid or not

Definition at line 132 of file LinkProcessor.php.

◆ convertInternalLink()

static convertInternalLink (   $url,
LinkProcessorStrategy  $strategy 
)
staticprotected

Convert an internal link.

Parameters
$urlThe url to convert
$strategyThe strategy used to check and create urls
Returns
The converted url

Definition at line 171 of file LinkProcessor.php.