MediaWiki  REL1_22
cleanupPreferences.php
Go to the documentation of this file.
00001 <?php
00026 require_once __DIR__ . '/Maintenance.php';
00027 
00033 class CleanupPreferences extends Maintenance {
00034     public function execute() {
00035         global $wgHiddenPrefs;
00036 
00037         $dbw = wfGetDB( DB_MASTER );
00038         $dbw->begin( __METHOD__ );
00039         foreach ( $wgHiddenPrefs as $item ) {
00040             $dbw->delete(
00041                 'user_properties',
00042                 array( 'up_property' => $item ),
00043                 __METHOD__
00044             );
00045         };
00046         $dbw->commit( __METHOD__ );
00047         $this->output( "Finished!\n" );
00048     }
00049 }
00050 
00051 $maintClass = 'CleanupPreferences'; // Tells it to run the class
00052 require_once RUN_MAINTENANCE_IF_MAIN;