* Fix unlogged automatic user creation: run wfLBFactory()->shutdown() unconditionally in api.php. If you want to optimise it, do it in the database backend, since there's no way for the MW core to indicate to the web API that a write query has been performed. The previous code was also wrong in that it didn't commit transactions on foreign connections.

* Fixed debugging code left in (mustBePosted disabled).
This commit is contained in:
Tim Starling 2008-05-17 04:26:26 +00:00
parent 47479fe6cf
commit a4eaa89625
3 changed files with 7 additions and 9 deletions

View file

@ -83,3 +83,6 @@ wfDoUpdates();
wfProfileOut('api.php');
wfLogProfilingData();
// Shut down the database
wfGetLBFactory()->shutdown();

View file

@ -223,7 +223,7 @@ class ApiLogin extends ApiBase {
return wfMemcKey( 'apilogin', 'badlogin', 'ip', wfGetIP() );
}
//public function mustBePosted() { return true; }
public function mustBePosted() { return true; }
public function getAllowedParams() {
return array (

View file

@ -199,10 +199,9 @@ class ApiMain extends ApiBase {
/**
* Schedule a database commit
* @deprecated
*/
public function scheduleCommit() {
$this->mCommit = true;
}
public function scheduleCommit() {}
/**
* Execute api request. Any errors will be handled if the API was called by the remote client.
@ -213,11 +212,7 @@ class ApiMain extends ApiBase {
$this->executeAction();
else
$this->executeActionWithErrorHandling();
if($this->mCommit)
{
$dbw = wfGetDb(DB_MASTER);
$dbw->immediateCommit();
}
$this->profileOut();
}