Config
abstract class Config (View source)
Constants
UNINHERITED |
source options bitmask value - only get configuration set for this
specific class, not any of it's parents. |
EXCLUDE_EXTRA_SOURCES |
|
NO_DELTAS |
Disable all modifications to the config |
Methods
Make the newly active Config be a copy of the current active Config instance.
Change the active Config back to the Config instance the current active Config object was copied from.
Get an accessor that returns results by class by default.
Perform the given operation in an isolated config state.
Details
static ConfigCollectionInterface
inst()
Get the current active Config instance.
In general use you will use this method to obtain the current Config instance. It assumes the config instance has already been set.
static MutableConfigCollectionInterface
modify()
Make this config available to be modified
static ConfigCollectionInterface
nest()
Make the newly active Config be a copy of the current active Config instance.
You can then make changes to the configuration by calling update and remove on the new value returned by Config::inst(), and then discard those changes later by calling unnest.
static ConfigCollectionInterface
unnest()
Change the active Config back to the Config instance the current active Config object was copied from.
static Config_ForClass
forClass(string $class)
Get an accessor that returns results by class by default.
Shouldn't be overridden, since there might be many Config_ForClass instances already held in the wild. Each Config_ForClass instance asks the current_instance of Config for the actual result, so override that instead
static mixed
withConfig(callable $callback)
Perform the given operation in an isolated config state.
On return, the config state will be restored, so any modifications are temporary.