class ModuleManifest

A utility class which builds a manifest of configuration items

Traits

Provides extensions to this object to integrate it with standard config API methods.

Constants

PROJECT_KEY

Config options

module_priority array List of modules sorted by priority
project string Project name

Methods

static Config_ForClass
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .

mixed
stat(string $name) deprecated

Get inherited config value

mixed
uninherited(string $name)

Gets the uninherited value for the given config option

$this
set_stat(string $name, mixed $value) deprecated

Update the config value for a given property

addModule(string $path)

Adds a path as a module

bool
moduleExists(string $name)

Returns true if the passed module exists

__construct(string $base, CacheFactory $cacheFactory = null)

Constructs and initialises a new configuration object, either loading from the cache or re-scanning for classes.

init(bool $includeTests = false, bool $forceRegen = false)

No description

activateConfig()

Includes all of the php _config.php files found by this manifest.

regenerate(bool $includeTests = false)

Completely regenerates the manifest file. Scans through finding all php _config.php and yaml _config/*.ya?ml files,parses the yaml files into fragments, sorts them and figures out what values need to be checked to pick the correct variant.

getModule(string $name)

Get module by name

Module[]
getModules()

Get modules found

void
sort()

Sort modules sorted by priority

getModuleByPath(string $path)

Get module that contains the given path

Details

in Configurable at line 20
static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .

....).

Return Value

Config_ForClass

in Configurable at line 32
mixed stat(string $name) deprecated

deprecated 5.0 Use ->config()->get() instead

Get inherited config value

Parameters

string $name

Return Value

mixed

in Configurable at line 44
mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

in Configurable at line 57
$this set_stat(string $name, mixed $value) deprecated

deprecated 5.0 Use ->config()->set() instead

Update the config value for a given property

Parameters

string $name
mixed $value

Return Value

$this

at line 74
addModule(string $path)

Adds a path as a module

Parameters

string $path

at line 101
bool moduleExists(string $name)

Returns true if the passed module exists

Parameters

string $name Either full composer name or short name

Return Value

bool

at line 114
__construct(string $base, CacheFactory $cacheFactory = null)

Constructs and initialises a new configuration object, either loading from the cache or re-scanning for classes.

Parameters

string $base The project base path.
CacheFactory $cacheFactory Cache factory to use

at line 125
init(bool $includeTests = false, bool $forceRegen = false)

Parameters

bool $includeTests
bool $forceRegen Force the manifest to be regenerated.

at line 147
activateConfig()

Includes all of the php _config.php files found by this manifest.

at line 166
regenerate(bool $includeTests = false)

Completely regenerates the manifest file. Scans through finding all php _config.php and yaml _config/*.ya?ml files,parses the yaml files into fragments, sorts them and figures out what values need to be checked to pick the correct variant.

Does not build the actual variant

Parameters

bool $includeTests

at line 198
Module getModule(string $name)

Get module by name

Parameters

string $name

Return Value

Module

at line 222
Module[] getModules()

Get modules found

Return Value

Module[]

at line 232
void sort()

Sort modules sorted by priority

Return Value

void

at line 259
Module getModuleByPath(string $path)

Get module that contains the given path

Parameters

string $path Full filesystem path to the given file

Return Value

Module The module, or null if not a path in any module