Skip to content
No description or website provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
classes
db
lang/en
tests/behat
README.md
conf.php
lib.php
settings.php
version.php

README.md

Advanced Config

What does it do?

Right now not much. It gives you a different avenue to define config settings that is similar to how it is done in settings.php and they can be appended to existing admin setting pages defined in settings.php.

But those config settings will suddenly become able to be overridden at a category level! Categories inherit configuration settings from their parent categories if they don't anything set for themselves. This works all the way up to the site configuration level.

This feature came about because at Monash Uni we needed to be able to set some pluging settings depending on which faculty(category) a course was in. At first there was one setting but we soon discovered there were many so instead we set about to build a generic solution to a generic problem.

See an example of it with pictures on my blog

Future work

Long term the aim of the project is to disconnect the defining, validating and writing of configuration settings from the Moodle settings tree web interface. This would allow for settings to be read and written from web services and CLI etc.

  • Ability to view the tree of configuration inheritance for an individual setting
  • Auditable setting edit log(critical)
  • Web service for viewing/editing configuration data
  • CLI for viewing/editing configuration data
  • Configuration flag for settings to enable inheritance(default to site level config)
  • World domination! (integration with Moodle core, maybe, someday, if they like it)

How do I use it?

Look at the classes/model/settings.php and classes/model/tree.php files. They are interfaces that you must implement to define configuration settings.

Finally to retrieve a context specific config use the context_config::get_config function. It is similar to how the existing get_config functionality works.

You can’t perform that action at this time.