Config: Add Config and GlobalConfig classes
authorKunal Mehta <legoktm@gmail.com>
Fri, 24 Jan 2014 01:45:11 +0000 (17:45 -0800)
committerKunal Mehta <legoktm@gmail.com>
Tue, 28 Jan 2014 05:10:30 +0000 (21:10 -0800)
commitfbfe789b987b4cfd060c429d474a7529739fd0d3
treed9429af9953e8f762504f5ed57d700898bbe41ac
parent63afd3d02d8fb6d45941ed404f8b925a0252d1e3
Config: Add Config and GlobalConfig classes

Allows configuration options to be fetched from context.

Only one implementation, GlobalConfig, is provided, which
simply returns $GLOBALS[$name]. There can be more classes
in the future, possibly a database-based one. For convinience
the "wg" prefix is automatically added.

Ironically, this adds the $wgConfigClass global variable
which is used to determine which implementation of Config
to use by default.

The ContextSource getConfig and setConfig methods were introduced
in I23194d1ba (1.23), but have no uses in Gerrit, so they can safely
be re-purposed.

Change-Id: I13baec0b6d4ea7badf20b9c5f9b40846348838e4
includes/AutoLoader.php
includes/DefaultSettings.php
includes/config/Config.php [new file with mode: 0644]
includes/config/GlobalConfig.php [new file with mode: 0644]
includes/context/ContextSource.php
includes/context/DerivativeContext.php
includes/context/IContextSource.php
includes/context/RequestContext.php
tests/phpunit/includes/config/GlobalConfigTest.php [new file with mode: 0644]