Documentation

WorkerLinkChecker extends WorkerBase
in package

Base class for worker jobs, which are run via CLI in a separate process

Table of Contents

Properties

$job_name  : mixed
Specify a custom job name by overwriting this
$metric_names  : mixed
Specify up to three metrics

Methods

__construct()  : mixed
Constructor
checkUrl()  : mixed
Returns TRUE if the given URL is found, a string of the error message if the URL was not found.
getMetricNames()  : array<int, string>
Gets the metric names.
getName()  : string
Gets the job name
run()  : mixed
Do stuff
buildCsv()  : string|false
Build a CSV for the specified errors.
checkPage()  : mixed
Checks a single page

Properties

$job_name

Specify a custom job name by overwriting this

protected mixed $job_name = 'Link Checker'

$metric_names

Specify up to three metrics

protected mixed $metric_names = array(1 => 'Total pages', 2 => 'Pages processed', 3 => 'Bad links found')

Methods

__construct()

Constructor

public final __construct() : mixed

Manually checks if the method 'run' exists, because it's a varags, so can't use the normal abstract function approach

checkUrl()

Returns TRUE if the given URL is found, a string of the error message if the URL was not found.

public checkUrl(mixed $href[, mixed $subsite_id = 1 ]) : mixed
Parameters
$href : mixed
$subsite_id : mixed = 1

getMetricNames()

Gets the metric names.

public getMetricNames() : array<int, string>
Tags
inheritdoc
Return values
array<int, string>

getName()

Gets the job name

public getName() : string
Tags
inheritdoc
Return values
string

run()

Do stuff

public run([mixed $email_address = null ]) : mixed
Parameters
$email_address : mixed = null

buildCsv()

Build a CSV for the specified errors.

private buildCsv(array<string|int, mixed> $errs) : string|false
Parameters
$errs : array<string|int, mixed>
Return values
string|false —

csv file path or false on error

checkPage()

Checks a single page

private checkPage(mixed &$row, mixed &$errs) : mixed
Parameters
$row : mixed
$errs : mixed
On this page

Search results