\Horde_Pear_Package_Contents_Ignore_Git

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

Summary

Methods
Properties
Constants
__construct()
getIgnores()
getIncludes()
isIgnored()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_prepare()
_matches()
_getRegExpableSearchString()
$_ignore
$_include
$_root
N/A

Properties

$_ignore

$_ignore : array

The regular expressions for ignored files.

Type

array

$_include

$_include : array

The regular expressions for files to exclude from ignoring.

Type

array

$_root

$_root : string

The root position of the repository.

Type

string

Methods

__construct()

__construct(string  $gitignore, string  $root) 

Constructor.

Parameters

string $gitignore

The gitignore information

string $root

The root position for the files that should be checked.

getIgnores()

getIgnores() : array

Return the list of ignored patterns.

Returns

array —

The list of patterns.

getIncludes()

getIncludes() : array

Return the list of included patterns.

Returns

array —

The list of patterns.

isIgnored()

isIgnored(\SplFileInfo  $element) : boolean

Tell whether to ignore the element.

Parameters

\SplFileInfo $element

The element to check.

Returns

boolean —

True if the element should be ignored, false otherwise.

_prepare()

_prepare(string  $gitignore) : NULL

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

Parameters

string $gitignore

The content of the .gitignore file.

Returns

NULL

_matches()

_matches(array  $matches, string  $path) : NULL

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

Parameters

array $matches

The regular expression patterns.

string $path

The file path.

Returns

NULL

_getRegExpableSearchString()

_getRegExpableSearchString(string  $s) : string

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

Parameters

string $s

string with wildcards ? and *

Returns

string —

converts to ., ? to ., etc.