PHP Class Pagekit\Finder\Event\FileAccessEvent

Inheritance: extends Pagekit\Event\Event
Show file Open project: pagekit/pagekit

Protected Properties

Property Type Description
$notPaths string[]
$readPaths string[]
$writePaths string[]

Public Methods

Method Description
mode ( $path )
path ( string $pattern, string $mode = 'r' ) Adds a rule a path must match

Protected Methods

Method Description
isRegex ( string $str ) : boolean Checks whether the string is a regex.
toRegex ( string $str ) : string Converts strings to regexp.

Method Details

isRegex() protected method

Checks whether the string is a regex.
protected isRegex ( string $str ) : boolean
$str string
return boolean Whether the given string is a regex

mode() public method

public mode ( $path )

path() public method

You can use patterns (delimited with / sign) or simple strings. $event->path('some/special/dir', 'w') $event->path('/some\/special\/dir/', 'w') // same as above
public path ( string $pattern, string $mode = 'r' )
$pattern string A pattern (a regexp or a string)
$mode string ('r', 'read', 'w', 'write', '-', 'deny'

toRegex() protected method

PCRE patterns are left unchanged. Default conversion: 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' Use only / as directory separator (on Windows also).
protected toRegex ( string $str ) : string
$str string Pattern: regexp or dirname.
return string regexp corresponding to a given string or regexp

Property Details

$notPaths protected property

protected string[] $notPaths
return string[]

$readPaths protected property

protected string[] $readPaths
return string[]

$writePaths protected property

protected string[] $writePaths
return string[]