From: Aaron Schulz Date: Mon, 1 Jul 2013 18:26:45 +0000 (-0700) Subject: Dependency inject DB into ManualLogEntry::insert() X-Git-Tag: 1.31.0-rc.0~19301 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=07319ccba2da42e3d8954cf27c9c673646f6bd53;p=lhc%2Fweb%2Fwiklou.git Dependency inject DB into ManualLogEntry::insert() Change-Id: I5018a6ef6095929edca444ad2d901adcf8680ed2 --- 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 ) {