wiki.techinc.nl/maintenance/cleanupPreferences.php
Reedy 23477c7ef6 Remove BOM from cleanupPreferences
Change-Id: I3c049c0229bb9ed1365f2781baa44b4c8e1e1e18
2012-07-07 16:19:58 +01:00

29 lines
729 B
PHP
Executable file

<?php
/**
* Description: This script takes $wgHiddenPrefs and removes their preference from the DB. [[bugzilla:30976]]
* @author TyA <tya.wiki@gmail.com>
* @ingroup Maintenance
*/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
class CleanupPreferences extends Maintenance {
public function execute() {
global $wgHiddenPrefs;
$dbw = wfGetDB( DB_MASTER );
$dbw->begin();
foreach( $wgHiddenPrefs as $item ) {
$dbw->delete(
'user_properties',
array( 'up_property' => $item ),
__METHOD__
);
};
$dbw->commit();
$this->output( "Finished!\n" );
}
}
$maintClass = 'CleanupPreferences'; // Tells it to run the class
require_once( RUN_MAINTENANCE_IF_MAIN );