class ManifestFileFinder extends FileFinder (View source)

An extension to the default file finder with some extra filters to facilitate autoload and template manifest generation:

  • Only modules with _config.php files are scanned.

  • If a _manifest_exclude file is present inside a directory it is ignored.
  • Assets and module language directories are ignored.
  • Module tests directories are skipped if either of these conditions is meant:
    • the ignore_tests option is not set to false.
    • the module PHP CI configuration matches one of the ignored_ci_configs

Constants

CONFIG_FILE

CONFIG_DIR

EXCLUDE_FILE

LANG_DIR

TESTS_DIR

VENDOR_DIR

deprecated RESOURCES_DIR

Properties

protected static array $vcs_dirs from  FileFinder
protected static $default_options
protected array $options from  FileFinder

Methods

public
__construct()

No description

public
mixed
getOption(string $name)

Returns an option value set on this instance.

public
setOption(string $name, mixed $value)

Set an option on this finder instance. See SS_FileFinder for the list of options available.

public
setOptions(array $options)

Sets several options at once.

public
array
find(string $base)

Finds all files matching the options within a directory. The search is performed depth first.

public
bool
acceptDir(string $basename, string $pathname, int $depth)

Returns TRUE if the directory should be traversed. This can be overloaded to customise functionality, or extended with callbacks.

protected
bool
acceptFile(string $basename, string $pathname, int $depth)

Returns TRUE if the file should be included in the results. This can be overloaded to customise functionality, or extended via callbacks.

public
bool
isInsideVendor(string $basename, string $pathname, int $depth)

Check if the given dir is, or is inside the vendor folder

public
bool
isInsideThemes(string $basename, string $pathname, int $depth)

Check if the given dir is, or is inside the themes folder

public
bool
isInsideIgnored(string $basename, string $pathname, int $depth)

Check if this folder or any parent is ignored

public
bool
isInsideModule(string $basename, string $pathname, int $depth)

Check if this folder is inside any module

protected
bool
anyParents(string $basename, string $pathname, int $depth, callable $callback)

Check if any parents match the given callback

public
bool
isDirectoryModule(string $basename, string $pathname, string $depth)

Check if the given dir is a module root (not a subdir)

protected
string
upLevels(string $pathname, int $depth)

Get a parent path the given levels above

protected
array
getIgnoredDirs()

Get all ignored directories

public
bool
isDirectoryIgnored(string $basename, string $pathname, string $depth)

Check if the given directory is ignored

Details

__construct()

No description

mixed getOption(string $name)

Returns an option value set on this instance.

Parameters

string $name

Return Value

mixed

setOption(string $name, mixed $value)

Set an option on this finder instance. See SS_FileFinder for the list of options available.

Parameters

string $name
mixed $value

setOptions(array $options)

Sets several options at once.

Parameters

array $options

array find(string $base)

Finds all files matching the options within a directory. The search is performed depth first.

Parameters

string $base

Return Value

array

bool acceptDir(string $basename, string $pathname, int $depth)

Returns TRUE if the directory should be traversed. This can be overloaded to customise functionality, or extended with callbacks.

Parameters

string $basename
string $pathname
int $depth

Return Value

bool

protected bool acceptFile(string $basename, string $pathname, int $depth)

Returns TRUE if the file should be included in the results. This can be overloaded to customise functionality, or extended via callbacks.

Parameters

string $basename
string $pathname
int $depth

Return Value

bool

bool isInsideVendor(string $basename, string $pathname, int $depth)

Check if the given dir is, or is inside the vendor folder

Parameters

string $basename
string $pathname
int $depth

Return Value

bool

bool isInsideThemes(string $basename, string $pathname, int $depth)

Check if the given dir is, or is inside the themes folder

Parameters

string $basename
string $pathname
int $depth

Return Value

bool

bool isInsideIgnored(string $basename, string $pathname, int $depth)

Check if this folder or any parent is ignored

Parameters

string $basename
string $pathname
int $depth

Return Value

bool

bool isInsideModule(string $basename, string $pathname, int $depth)

Check if this folder is inside any module

Parameters

string $basename
string $pathname
int $depth

Return Value

bool

protected bool anyParents(string $basename, string $pathname, int $depth, callable $callback)

Check if any parents match the given callback

Parameters

string $basename
string $pathname
int $depth
callable $callback

Return Value

bool

bool isDirectoryModule(string $basename, string $pathname, string $depth)

Check if the given dir is a module root (not a subdir)

Parameters

string $basename
string $pathname
string $depth

Return Value

bool

protected string upLevels(string $pathname, int $depth)

Get a parent path the given levels above

Parameters

string $pathname
int $depth

Number of parents to rise

Return Value

string

protected array getIgnoredDirs()

Get all ignored directories

Return Value

array

bool isDirectoryIgnored(string $basename, string $pathname, string $depth)

Check if the given directory is ignored

Parameters

string $basename
string $pathname
string $depth

Return Value

bool