X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=maintenance%2FcleanupPreferences.php;h=6e58ae9741941f193784981b15088c4a2a4f4440;hb=fb52b789201fcad7a243c13f4371a69d1976369a;hp=3539689a3e2529c6c38fecf416900664ad26f42f;hpb=030924934af0f3dbbed76c5ea7d106208a7760ff;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupPreferences.php b/maintenance/cleanupPreferences.php index 3539689a3e..6e58ae9741 100644 --- a/maintenance/cleanupPreferences.php +++ b/maintenance/cleanupPreferences.php @@ -19,11 +19,11 @@ * * @file * @author TyA - * @see [[bugzilla:30976]] + * @see https://phabricator.wikimedia.org/T32976 * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script that removes hidden preferences from the database. @@ -34,19 +34,19 @@ class CleanupPreferences extends Maintenance { public function execute() { global $wgHiddenPrefs; - $dbw = wfGetDB( DB_MASTER ); - $dbw->begin(); - foreach( $wgHiddenPrefs as $item ) { + $dbw = $this->getDB( DB_MASTER ); + $this->beginTransaction( $dbw, __METHOD__ ); + foreach ( $wgHiddenPrefs as $item ) { $dbw->delete( 'user_properties', - array( 'up_property' => $item ), + [ 'up_property' => $item ], __METHOD__ ); }; - $dbw->commit(); + $this->commitTransaction( $dbw, __METHOD__ ); $this->output( "Finished!\n" ); } } $maintClass = 'CleanupPreferences'; // Tells it to run the class -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;