Manual:Configuration for developers


 * For documentation about configuring MediaWiki, see Manual:Configuration.

Starting with MediaWiki 1.23, a new interface for accessing configuration options was added. This will allow us to abstract the backend in which we store configuration options. This is a guide for core and extension developers on the new way to access configuration settings.

Pre-1.23 code would look like:

1.23+ code should now look like this:

You'll notice a few changes here:
 * We use  to get the default   object.
 * Rather than checking for "wgFoo", you ask the Config object for "Foo". The wg prefix is automatically handled.

If you don't have access to any ContextSources, you can use.

This should not be used to fetch global variable objects like  or.

Custom prefixes
In the past, some extensions used "eg" instead of "wg". We want to move away from prefixes, but you can still continue to use them: