MediaWiki master
TableCleanup Class Reference

Generic class to cleanup a database table. More...

Inherits Maintenance.

Inherited by CleanupCaps, CleanupImages, CleanupPageLang, CleanupWatchlist, and TitleCleanup.

Collaboration diagram for TableCleanup:

Public Member Functions

 __construct ()
 
 execute ()
 
 runTable ( $params)
 

Protected Member Functions

 hexChar ( $matches)
 
 init ( $count, $table)
 
 progress ( $updated)
 

Protected Attributes

int $count
 
array $defaultParams
 
bool $dryrun = false
 
int $processed
 
int $reportInterval = 100
 
float $startTime
 
string $table
 
int $updated
 

Detailed Description

Generic class to cleanup a database table.

Already subclasses Maintenance.

Definition at line 35 of file TableCleanup.php.

Constructor & Destructor Documentation

◆ __construct()

TableCleanup::__construct ( )

Reimplemented in CleanupCaps, CleanupImages, CleanupPageLang, TitleCleanup, and CleanupWatchlist.

Definition at line 55 of file TableCleanup.php.

Member Function Documentation

◆ execute()

TableCleanup::execute ( )

Reimplemented in CleanupCaps, TitleCleanup, and CleanupWatchlist.

Definition at line 62 of file TableCleanup.php.

References runTable().

◆ hexChar()

TableCleanup::hexChar ( $matches)
protected
Parameters
string[]$matches
Returns
string

Definition at line 181 of file TableCleanup.php.

References $matches.

◆ init()

TableCleanup::init ( $count,
$table )
protected

Definition at line 76 of file TableCleanup.php.

References $count, and $table.

Referenced by runTable().

◆ progress()

◆ runTable()

TableCleanup::runTable ( $params)
Parameters
array$params

Definition at line 120 of file TableCleanup.php.

References $count, $params, $table, and init().

Referenced by CleanupCaps\execute(), and execute().

Member Data Documentation

◆ $count

int TableCleanup::$count
protected

Definition at line 51 of file TableCleanup.php.

Referenced by init(), progress(), and runTable().

◆ $defaultParams

array TableCleanup::$defaultParams
protected
Initial value:
= [
'table' => 'page',
'conds' => [],
'index' => 'page_id',
'callback' => 'processRow',
]

Definition at line 37 of file TableCleanup.php.

◆ $dryrun

bool TableCleanup::$dryrun = false
protected

Definition at line 45 of file TableCleanup.php.

◆ $processed

int TableCleanup::$processed
protected

Definition at line 49 of file TableCleanup.php.

Referenced by progress().

◆ $reportInterval

int TableCleanup::$reportInterval = 100
protected

Definition at line 47 of file TableCleanup.php.

◆ $startTime

float TableCleanup::$startTime
protected

Definition at line 52 of file TableCleanup.php.

Referenced by progress().

◆ $table

string TableCleanup::$table
protected

Definition at line 53 of file TableCleanup.php.

Referenced by init(), and runTable().

◆ $updated

int TableCleanup::$updated
protected

Definition at line 50 of file TableCleanup.php.

Referenced by CleanupWatchlist\processRow(), and progress().


The documentation for this class was generated from the following file: