Add exposeGlobals() b/c stuff
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 16 May 2011 21:14:51 +0000 (21:14 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 16 May 2011 21:14:51 +0000 (21:14 +0000)
includes/conf/Conf.php

index 99dc38b..3544f20 100755 (executable)
@@ -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;
+               }
        }
 
        /**