Skip to content

Conversation

@Niteshvgupta
Copy link

The purpose of this commit is to allow support for access to set and get run-time options. Extensions of Monolog, such as Cascade, will need to set a run-time options from a config file and access it after parsing and losing access to the config file.

* @return bool
*/
public static function hasOption($name)
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is safer to do array_key_exists($name, static::$options) in case someone sets a value as null for some reason. Also, when accessing static member variables and properties, prefer static:: to self::. The reason is that static supports late static binding whereas self does not.

@PhiloEpisteme
Copy link

Can you explain what the purpose of these run-time options is? One use case we need is to change behavior when we ask Cascade for a logger that does not exist. It feels like that work can be in Cascade and not in Monolog. For example, Cascade could ask the Monolog::Registry for a logger, if it doesn't exist, ask for the first parent, if it doesn't exist ask for the next parent etc until one is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants