+ $tpl = $this->prepareQuickTemplate( $out );
+ // execute template
+ wfProfileIn( __METHOD__ . '-execute' );
+ $res = $tpl->execute();
+ wfProfileOut( __METHOD__ . '-execute' );
+
+ // result may be an error
+ $this->printOrError( $res );
+
+ if ( $oldContext ) {
+ $this->setContext( $oldContext );
+ }
+
+ wfProfileOut( __METHOD__ );
+ }
+
+ /**
+ * initialize various variables and generate the template
+ *
+ * @since 1.23
+ * @param $out OutputPage
+ * @return QuickTemplate the template to be executed by outputPage
+ */
+ protected function prepareQuickTemplate( OutputPage $out = null ) {
+ global $wgContLang, $wgScript, $wgStylePath,
+ $wgMimeType, $wgJsMimeType, $wgXhtmlNamespaces, $wgHtml5Version,
+ $wgDisableCounters, $wgSitename, $wgLogo, $wgMaxCredits,
+ $wgShowCreditsIfMax, $wgPageShowWatchingUsers, $wgArticlePath,
+ $wgScriptPath, $wgServer;
+
+ wfProfileIn( __METHOD__ );