Clean up transactions in maintenance scripts
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 22 Dec 2015 08:51:42 +0000 (00:51 -0800)
committerReedy <reedy@wikimedia.org>
Wed, 30 Dec 2015 23:40:35 +0000 (23:40 +0000)
commitfa8e1a9b00d872f445b65312f554db03230a5502
tree40cdb82be57a60cfb688a61e144cf21ba62fc081
parent1083c617962024babcc4e6478d32c61eb587295f
Clean up transactions in maintenance scripts

Add transaction methods to complement getDB().
This makes it easy to grep for direct begin()/commit()
calls to IDatabase by having script use their own
wrapper. Maintenance scripts are one of the few places
that can (and need to) use begin/commit instead of the
start/end atomic methods.

Eventually, there should be almost no direct callers
and those methods can be made stricter about throwing
errors on nested calls.

Change-Id: Ibbfc7a77c0d2a55f7fc2261087f6c3a19061e0aa
22 files changed:
maintenance/Maintenance.php
maintenance/cleanupImages.php
maintenance/cleanupPreferences.php
maintenance/cleanupSpam.php
maintenance/deleteArchivedFiles.php
maintenance/deleteOldRevisions.php
maintenance/deleteOrphanedRevisions.php
maintenance/deleteSelfExternals.php
maintenance/migrateUserGroup.php
maintenance/moveBatch.php
maintenance/nukeNS.php
maintenance/nukePage.php
maintenance/populateLogUsertext.php
maintenance/populateRevisionLength.php
maintenance/populateRevisionSha1.php
maintenance/reassignEdits.php
maintenance/rebuildFileCache.php
maintenance/storage/compressOld.php
maintenance/storage/fixBug20757.php
maintenance/storage/recompressTracked.php
maintenance/updateCollation.php
maintenance/wrapOldPasswords.php