From 07319ccba2da42e3d8954cf27c9c673646f6bd53 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 1 Jul 2013 11:26:45 -0700 Subject: [PATCH] Dependency inject DB into ManualLogEntry::insert() Change-Id: I5018a6ef6095929edca444ad2d901adcf8680ed2 --- includes/logging/LogEntry.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index b99f16bd09..92a0abe4b5 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -430,12 +430,13 @@ class ManualLogEntry extends LogEntryBase { /** * Inserts the entry into the logging table. + * @param DatabaseBase $dbw * @return int If of the log entry */ - public function insert() { + public function insert( DatabaseBase $dbw = null ) { global $wgContLang; - $dbw = wfGetDB( DB_MASTER ); + $dbw = $dbw ?: wfGetDB( DB_MASTER ); $id = $dbw->nextSequenceValue( 'logging_log_id_seq' ); if ( $this->timestamp === null ) { -- 2.20.1