Merge "Replace Linker::link() usage with LinkRenderer"
[lhc/web/wiklou.git] / includes / TemplateParser.php
index 6420dc7..470a75c 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+use MediaWiki\MediaWikiServices;
+
 /**
  * Handles compiling Mustache templates into PHP rendering functions
  *
@@ -38,7 +40,7 @@ class TemplateParser {
 
        /**
         * @param string $templateDir
-        * @param boolean $forceRecompile
+        * @param bool $forceRecompile
         */
        public function __construct( $templateDir = null, $forceRecompile = false ) {
                $this->templateDir = $templateDir ?: __DIR__ . '/templates';
@@ -98,7 +100,7 @@ class TemplateParser {
                $fastHash = md5( $fileContents );
 
                // Fetch a secret key for building a keyed hash of the PHP code
-               $config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
+               $config = MediaWikiServices::getInstance()->getMainConfig();
                $secretKey = $config->get( 'SecretKey' );
 
                if ( $secretKey ) {
@@ -186,10 +188,10 @@ class TemplateParser {
         * @code
         *     echo $templateParser->processTemplate(
         *         'ExampleTemplate',
-        *         array(
+        *         [
         *             'username' => $user->getName(),
         *             'message' => 'Hello!'
-        *         )
+        *         ]
         *     );
         * @endcode
         * @param string $templateName The name of the template