Pass the full context to the ApiMain instance from api.php.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 6 Jul 2012 08:41:17 +0000 (10:41 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 6 Jul 2012 17:04:50 +0000 (19:04 +0200)
Passing only the WebRequest instance is not the best
thing when it accepts a complete context.

Change-Id: If02148c850b395a2382f87cbeafbc25887ce8728

api.php

diff --git a/api.php b/api.php
index 1d75857..9e1f5dd 100644 (file)
--- a/api.php
+++ b/api.php
@@ -70,7 +70,7 @@ $wgTitle = Title::makeTitle( NS_MAIN, 'API' );
  * is some form of an ApiMain, possibly even one that produces an error message,
  * but we don't care here, as that is handled by the ctor.
  */
-$processor = new ApiMain( $wgRequest, $wgEnableWriteAPI );
+$processor = new ApiMain( RequestContext::getMain(), $wgEnableWriteAPI );
 
 // Process data & print results
 $processor->execute();