From: Chad Horohoe Date: Mon, 16 May 2011 21:14:51 +0000 (+0000) Subject: Add exposeGlobals() b/c stuff X-Git-Tag: 1.31.0-rc.0~30119 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/?a=commitdiff_plain;h=7e7bbebda91b34e451f24c3641c433c3a376da79;p=lhc%2Fweb%2Fwiklou.git Add exposeGlobals() b/c stuff --- diff --git a/includes/conf/Conf.php b/includes/conf/Conf.php index 99dc38b39c..3544f20092 100755 --- a/includes/conf/Conf.php +++ b/includes/conf/Conf.php @@ -57,6 +57,20 @@ abstract class Conf { // @todo implement this: // $this->initExtensionDefaults(); $this->initChangedSettings(); + if( isset( $confConfig['exposeGlobals'] ) ) { + $this->exposeGlobals(); + } + } + + /** + * Expose all config variables as globals for back-compat. Ewwww. + */ + private function exposeGlobals() { + $allVars = $this->defaults + $this->extensionDefaults + $this->values; + foreach( $allVars as $name => $value ) { + $var = 'wg' . ucfirst( $name ); + $GLOBALS[$var] = $value; + } } /**