Make data loading a bit better in ApiDelete.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 16 Apr 2012 11:18:10 +0000 (13:18 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 16 Apr 2012 11:18:10 +0000 (13:18 +0200)
commitfbd17f8f52a0dde1bf6fdfc06cc49bb314ecdce9
treeb2a315b0751e56c244168c705535b88aeb574385
parentddcf8cc660c810f1601b61c90aa33cb36ca60cad
Make data loading a bit better in ApiDelete.

* Use WikiPage::newFromID() directly instead of Title::newFromID() (for now it does not change anything but it will soon)
* Directly load the data from the master when creating a page from its name, it avoids both having out-of-date information
  when doing the existence check and a second database query from LinkCache::addLinkObj() when calling (WikiPage|Title)::exists()
* Moved the page existence check to only be executed when creating a title from its name since if we have a WikiPage from its ID it must exist.

Change-Id: Ifaff725d955ce111c46d6b7f00610191820f3ced
includes/api/ApiDelete.php