\DefaultContextProvider
Synopsis
class DefaultContextProvider
implements
ContextProvider
{
- // members
- protected array $propertyCache = ;
- protected array $handlers = ;
- // methods
- protected void getHandlers()
- public void getProperties()
- public void getCacheKey()
- public void getMetadata()
- public void register_handler()
Hierarchy
Implements
Members
protected
- $handlers
—
array
A list of handlers that the context provider uses to determine values that are requested. Each of these is an instance that implements ContextProvider. This is initialised on demand by getHandlers(). - $propertyCache
—
array
A cache that maps cache keys derived from a property request to the value or values from fetching that request. The value or values are ContextProperty objects.
Methods
protected
- getHandlers() — Gets the list of handlers. The handler list is populated on demand from the Config system. It uses register_handler() to register the handlers that are defined.
public
- getCacheKey()
- getMetadata()
- getProperties() — Given a set of properties, return their values where known.
- register_handler() — Register a context handler. Generally this is not called directly, but from getHandlers() which reads the config on demand and registers the handlers that way. However, this function can also be used by unit tests to bypass the config system.