Quick fix in case search_path started out empty.
[lhc/web/wiklou.git] / api.php
diff --git a/api.php b/api.php
index ce445ef..817f4bc 100644 (file)
--- a/api.php
+++ b/api.php
@@ -64,7 +64,7 @@ if( strcmp( "$wgScriptPath/api$wgScriptExtension", $url ) ) {
 if (!$wgEnableAPI) {
        echo 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php';
        echo '<pre><b>$wgEnableAPI=true;</b></pre>';
-       die(-1);
+       die(1);
 }
 
 /* Construct an ApiMain with the arguments passed via the URL. What we get back
@@ -76,7 +76,13 @@ $processor = new ApiMain($wgRequest, $wgEnableWriteAPI);
 // Process data & print results
 $processor->execute();
 
+// Execute any deferred updates
+wfDoUpdates();
+
 // Log what the user did, for book-keeping purposes.
 wfProfileOut('api.php');
 wfLogProfilingData();
 
+// Shut down the database
+wfGetLBFactory()->shutdown();
+