Merge "Made User::newTouchedTimestamp handle clock skew a bit better"
[lhc/web/wiklou.git] / api.php
diff --git a/api.php b/api.php
index d63f254..9212747 100644 (file)
--- a/api.php
+++ b/api.php
@@ -30,6 +30,8 @@
  * @file
  */
 
+use MediaWiki\Logger\LegacyLogger;
+
 // So extensions (and other code) can check whether they're running in API mode
 define( 'MW_API', true );
 
@@ -61,6 +63,10 @@ if ( !$wgEnableAPI ) {
 // In a perfect world this wouldn't be necessary
 $wgTitle = Title::makeTitle( NS_MAIN, 'API' );
 
+// RequestContext will read from $wgTitle, but it will also whine about it.
+// In a perfect world this wouldn't be necessary either.
+RequestContext::getMain()->setTitle( $wgTitle );
+
 try {
        /* Construct an ApiMain with the arguments passed via the URL. What we get back
         * is some form of an ApiMain, possibly even one that produces an error message,
@@ -120,7 +126,7 @@ if ( $wgAPIRequestLog ) {
        } else {
                $items[] = "failed in ApiBeforeMain";
        }
-       MWLoggerLegacyLogger::emit( implode( ',', $items ) . "\n", $wgAPIRequestLog );
+       LegacyLogger::emit( implode( ',', $items ) . "\n", $wgAPIRequestLog );
        wfDebug( "Logged API request to $wgAPIRequestLog\n" );
 }