(bug 41171) Refactor User::edits() and User::incEditCount()
authorMarius Hoch <hoo@online.de>
Thu, 18 Oct 2012 15:07:08 +0000 (17:07 +0200)
committerMarius Hoch <hoo@online.de>
Thu, 18 Oct 2012 15:14:24 +0000 (17:14 +0200)
commitd0520bef02658d1365cc54a9546a52a2a09339d3
tree109a516263f6f67b4ece88287971862d49f5b8ef
parent6b59faefef0094cae7f1419526e2551fd1430122
(bug 41171) Refactor User::edits() and User::incEditCount()

User::edits() lets you fetch a cached number of edits from a slave database.
in case the field is not yet filed, we initialize if by hitting the `revision`
table and saving the result in user_editcount.

User::incEditCount() updates the edit countr and also does a lazy
initialization, if needed.

As both methods use the same $dbw->update() statement for this, I've
created a new, protected initEditCount() function which can take care of that.

Change-Id: If111270a84d4278bc4ea14d32ae602069f7c276f
includes/User.php