MediaWiki REL1_30
cleanupPreferences.php
Go to the documentation of this file.
1<?php
26require_once __DIR__ . '/Maintenance.php';
27
34 public function execute() {
35 global $wgHiddenPrefs;
36
37 $dbw = $this->getDB( DB_MASTER );
38 $this->beginTransaction( $dbw, __METHOD__ );
39 foreach ( $wgHiddenPrefs as $item ) {
40 $dbw->delete(
41 'user_properties',
42 [ 'up_property' => $item ],
43 __METHOD__
44 );
45 };
46 $this->commitTransaction( $dbw, __METHOD__ );
47 $this->output( "Finished!\n" );
48 }
49}
50
51$maintClass = 'CleanupPreferences'; // Tells it to run the class
52require_once RUN_MAINTENANCE_IF_MAIN;
$wgHiddenPrefs
An array of preferences to not show for the user.
Maintenance script that removes hidden preferences from the database.
execute()
Do the actual work.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
beginTransaction(IDatabase $dbw, $fname)
Begin a transcation on a DB.
commitTransaction(IDatabase $dbw, $fname)
Commit the transcation on a DB handle and wait for replica DBs to catch up.
getDB( $db, $groups=[], $wiki=false)
Returns a database to be used by current maintenance script.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling output() to send it all. It could be easily changed to send incrementally if that becomes useful
require_once RUN_MAINTENANCE_IF_MAIN
const DB_MASTER
Definition defines.php:26