Documentation

CrawlerDetect
in package

Table of Contents

$compiledExclusions  : string
The compiled exclusions regex string.
$compiledRegex  : string
The compiled regex string.
$crawlers  : Crawlers
Crawlers object.
$exclusions  : Exclusions
Exclusions object.
$httpHeaders  : array<string|int, mixed>
Headers that contain a user agent.
$matches  : array<string|int, mixed>
Store regex matches.
$uaHttpHeaders  : Headers
Headers object.
$userAgent  : null
The user agent.
__construct()  : mixed
Class constructor.
compileRegex()  : string
Compile the regex patterns into one regex string.
getMatches()  : string|null
Return the matches.
getUaHttpHeaders()  : array<string|int, mixed>
Return user agent headers.
isCrawler()  : bool
Check user agent string against the regex.
setHttpHeaders()  : mixed
Set HTTP headers.
setUserAgent()  : mixed
Set the user agent.

Properties

$compiledExclusions

The compiled exclusions regex string.

protected string $compiledExclusions

$compiledRegex

The compiled regex string.

protected string $compiledRegex

$httpHeaders

Headers that contain a user agent.

protected array<string|int, mixed> $httpHeaders = array()

$matches

Store regex matches.

protected array<string|int, mixed> $matches = array()

Methods

__construct()

Class constructor.

public __construct([array<string|int, mixed> $headers = null ][, mixed $userAgent = null ]) : mixed
Parameters
$headers : array<string|int, mixed> = null
$userAgent : mixed = null
Return values
mixed

compileRegex()

Compile the regex patterns into one regex string.

public compileRegex(mixed $patterns) : string
Parameters
$patterns : mixed
Return values
string

getMatches()

Return the matches.

public getMatches() : string|null
Return values
string|null

getUaHttpHeaders()

Return user agent headers.

public getUaHttpHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

isCrawler()

Check user agent string against the regex.

public isCrawler([string|null $userAgent = null ]) : bool
Parameters
$userAgent : string|null = null
Return values
bool

setHttpHeaders()

Set HTTP headers.

public setHttpHeaders(array<string|int, mixed>|null $httpHeaders) : mixed
Parameters
$httpHeaders : array<string|int, mixed>|null
Return values
mixed

setUserAgent()

Set the user agent.

public setUserAgent(string $userAgent) : mixed
Parameters
$userAgent : string
Return values
mixed

Search results