/**
* Set the Title object
*
- * @param Title $t
+ * @param Title $title
*/
- public function setTitle( Title $t ) {
- $this->title = $t;
+ public function setTitle( Title $title ) {
+ $this->title = $title;
// Erase the WikiPage so a new one with the new title gets created.
$this->wikipage = null;
}
$e = new Exception;
wfDebugLog( 'recursion-guard', "Recursion detected:\n" . $e->getTraceAsString() );
- $code = $this->getConfig()->get( 'LanguageCode' ) ? : 'en';
+ $code = $this->getConfig()->get( 'LanguageCode' ) ?: 'en';
$this->lang = Language::factory( $code );
} elseif ( $this->lang === null ) {
$this->recursion = true;
return self::$instance;
}
+ /**
+ * Get the RequestContext object associated with the main request
+ * and gives a warning to the log, to find places, where a context maybe is missing.
+ *
+ * @return RequestContext
+ * @since 1.24
+ */
+ public static function getMainAndWarn( $func = __METHOD__ ) {
+ wfDebug( $func . ' called without context. ' .
+ "Using RequestContext::getMain() for sanity\n" );
+
+ return self::getMain();
+ }
+
/**
* Resets singleton returned by getMain(). Should be called only from unit tests.
*/