Documentation

Horde_Pear_Package_Contents_Ignore_Git
in package
implements Horde_Pear_Package_Contents_Ignore

Horde_Pear_Package_Contents_Ignore_Git:: indicates which files in a content listing should be ignored based on the contents from a .gitignore file.

Tags
author

Gunnar Wrobel wrobel@pardus.de

category

Horde

copyright

2010-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Interfaces, Classes and Traits

Horde_Pear_Package_Contents_Ignore
Horde_Pear_Package_Contents_Ignore:: defines "ignore" filters to be used when generating package.xml filelists.

Table of Contents

$_ignore  : array<string|int, mixed>
The regular expressions for ignored files.
$_include  : array<string|int, mixed>
The regular expressions for files to exclude from ignoring.
$_root  : string
The root position of the repository.
__construct()  : mixed
Constructor.
getIgnores()  : array<string|int, mixed>
Return the list of ignored patterns.
getIncludes()  : array<string|int, mixed>
Return the list of included patterns.
isIgnored()  : bool
Tell whether to ignore the element.
_getRegExpableSearchString()  : string
Converts $s into a string that can be used with preg_match
_matches()  : null
Does the given path match one of the regular expression patterns?
_prepare()  : null
Prepare the list of ignores and includes from the gitignore input.

Properties

$_ignore

The regular expressions for ignored files.

private array<string|int, mixed> $_ignore = array()

$_include

The regular expressions for files to exclude from ignoring.

private array<string|int, mixed> $_include = array()

$_root

The root position of the repository.

private string $_root

Methods

__construct()

Constructor.

public __construct(string $gitignore, string $root) : mixed
Parameters
$gitignore : string

The gitignore information

$root : string

The root position for the files that should be checked.

Return values
mixed

getIgnores()

Return the list of ignored patterns.

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

The list of patterns.

getIncludes()

Return the list of included patterns.

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

The list of patterns.

isIgnored()

Tell whether to ignore the element.

public isIgnored(SplFileInfo $element) : bool
Parameters
$element : SplFileInfo

The element to check.

Return values
bool

True if the element should be ignored, false otherwise.

_getRegExpableSearchString()

Converts $s into a string that can be used with preg_match

private _getRegExpableSearchString(string $s) : string
Parameters
$s : string

string with wildcards ? and *

Return values
string

converts * to .*, ? to ., etc.

_matches()

Does the given path match one of the regular expression patterns?

private _matches(array<string|int, mixed> $matches, string $path) : null
Parameters
$matches : array<string|int, mixed>

The regular expression patterns.

$path : string

The file path.

Return values
null

_prepare()

Prepare the list of ignores and includes from the gitignore input.

private _prepare(string $gitignore) : null
Parameters
$gitignore : string

The content of the .gitignore file.

Return values
null

Search results