HumHub Documentation (unofficial)

ExactMatch extends Filter
in package

AbstractYes

Table of Contents

Properties

$acceptedPaths  : array<string|int, mixed>
A list of file paths we've already accepted.
$basedir  : string
The top-level path we are filtering.
$config  : Config
The config data for the run.
$ignoreDirPatterns  : array<string|int, mixed>
A list of ignore patterns that apply to directories only.
$ignoreFilePatterns  : array<string|int, mixed>
A list of ignore patterns that apply to files only.
$ruleset  : Ruleset
The ruleset used for the run.
$allowedFiles  : array<string|int, mixed>
A list of files to include.
$disallowedFiles  : array<string|int, mixed>
A list of files to exclude.

Methods

__construct()  : void
Constructs a filter.
accept()  : bool
Check whether the current element of the iterator is acceptable.
getChildren()  : RecursiveIterator
Returns an iterator for the current entry.
getAllowedFiles()  : array<string|int, mixed>|null
Get a list of file paths to include.
getBlacklist()  : array<string|int, mixed>
Get a list of file paths to exclude.
getDisallowedFiles()  : array<string|int, mixed>|null
Get a list of file paths to exclude.
getWhitelist()  : array<string|int, mixed>
Get a list of file paths to include.
shouldIgnorePath()  : bool
Checks filtering rules to see if a path should be ignored.
shouldProcessFile()  : bool
Checks filtering rules to see if a file should be checked.

Properties

$acceptedPaths

A list of file paths we've already accepted.

protected array<string|int, mixed> $acceptedPaths = []

Used to ensure we aren't following circular symlinks.

$basedir

The top-level path we are filtering.

protected string $basedir = null

$config

The config data for the run.

protected Config $config = null

$ignoreDirPatterns

A list of ignore patterns that apply to directories only.

protected array<string|int, mixed> $ignoreDirPatterns = null

$ignoreFilePatterns

A list of ignore patterns that apply to files only.

protected array<string|int, mixed> $ignoreFilePatterns = null

$ruleset

The ruleset used for the run.

protected Ruleset $ruleset = null

$allowedFiles

A list of files to include.

private array<string|int, mixed> $allowedFiles = null

If the allowed files list is empty, only files in the disallowed files list will be excluded.

$disallowedFiles

A list of files to exclude.

private array<string|int, mixed> $disallowedFiles = null

Methods

__construct()

Constructs a filter.

public __construct(RecursiveIterator $iterator, string $basedir, Config $config, Ruleset $ruleset) : void
Parameters
$iterator : RecursiveIterator

The iterator we are using to get file paths.

$basedir : string

The top-level path we are filtering.

$config : Config

The config data for the run.

$ruleset : Ruleset

The ruleset used for the run.

accept()

Check whether the current element of the iterator is acceptable.

public accept() : bool

If a file is both disallowed and allowed, it will be deemed unacceptable.

Return values
bool

getChildren()

Returns an iterator for the current entry.

public getChildren() : RecursiveIterator

Ensures that the disallowed files list and the allowed files list are preserved so they don't have to be generated each time.

Return values
RecursiveIterator

getAllowedFiles()

Get a list of file paths to include.

protected getAllowedFiles() : array<string|int, mixed>|null
Tags
since
3.9.0

Replaces the deprecated getWhitelist() method.

Return values
array<string|int, mixed>|null

getBlacklist()

Get a list of file paths to exclude.

protected abstract getBlacklist() : array<string|int, mixed>
Tags
deprecated
3.9.0

Implement the getDisallowedFiles() method instead. The getDisallowedFiles() method will be made abstract and therefore required in v4.0 and this method will be removed. If both methods are implemented, the new getDisallowedFiles() method will take precedence.

Return values
array<string|int, mixed>

getDisallowedFiles()

Get a list of file paths to exclude.

protected getDisallowedFiles() : array<string|int, mixed>|null
Tags
since
3.9.0

Replaces the deprecated getBlacklist() method.

Return values
array<string|int, mixed>|null

getWhitelist()

Get a list of file paths to include.

protected abstract getWhitelist() : array<string|int, mixed>
Tags
deprecated
3.9.0

Implement the getAllowedFiles() method instead. The getAllowedFiles() method will be made abstract and therefore required in v4.0 and this method will be removed. If both methods are implemented, the new getAllowedFiles() method will take precedence.

Return values
array<string|int, mixed>

shouldIgnorePath()

Checks filtering rules to see if a path should be ignored.

protected shouldIgnorePath(string $path) : bool
Parameters
$path : string

The path to the file or directory being checked.

Return values
bool

shouldProcessFile()

Checks filtering rules to see if a file should be checked.

protected shouldProcessFile(string $path) : bool

Checks both file extension filters and path ignore filters.

Parameters
$path : string

The path to the file being checked.

Return values
bool

        
On this page

Search results