class TidyUpBug37714 extends Maintenance {
public function execute() {
// Search for all log entries which are about changing the visability of other log entries.
- $result = wfGetDB( DB_SLAVE )->select(
+ $result = $this->getDB( DB_SLAVE )->select(
'logging',
array( 'log_id', 'log_params' ),
array(
foreach ( $result as $row ) {
$paramLines = explode( "\n", $row->log_params );
$ids = explode( ',', $paramLines[0] ); // Array dereferencing is PHP >= 5.4 :(
- $result = wfGetDB( DB_SLAVE )->select( // Work out what log entries were changed here.
+ $result = $this->getDB( DB_SLAVE )->select( // Work out what log entries were changed here.
'logging',
'log_type',
array( 'log_id' => $ids ),
// If there's only one type, the target title can be set to include it.
$logTitle = SpecialPage::getTitleFor( 'Log', $result->current()->log_type )->getText();
$this->output( 'Set log_title to "' . $logTitle . '" for log entry ' . $row->log_id . ".\n" );
- wfGetDB( DB_MASTER )->update(
+ $this->getDB( DB_MASTER )->update(
'logging',
array( 'log_title' => $logTitle ),
array( 'log_id' => $row->log_id ),