No need to pass db around, should be the same
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 16 Apr 2008 17:34:52 +0000 (17:34 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 16 Apr 2008 17:34:52 +0000 (17:34 +0000)
includes/Article.php
includes/LogPage.php
includes/SpecialBlockip.php

index 95979f1..af347d7 100644 (file)
@@ -2361,7 +2361,7 @@ class Article {
                $logtype = $suppress ? 'suppress' : 'delete';
                $log = new LogPage( $logtype );
                # Make sure logging got through
-               $ok = $log->addEntry( 'delete', $this->mTitle, $reason, array(), $dbw );
+               $ok = $log->addEntry( 'delete', $this->mTitle, $reason, array() );
                if( !$ok ) {
                        $dbw->rollback();
                        return false;
index e86aadf..041d05c 100644 (file)
@@ -51,13 +51,13 @@ class LogPage {
                $this->updateRecentChanges = $rc;
        }
 
-       function saveContent( $dbw ) {
+       function saveContent() {
                if( wfReadOnly() ) return false;
 
                global $wgUser, $wgLogRestrictions;
                $fname = 'LogPage::saveContent';
 
-               $dbw = $dbw ? $dbw : wfGetDB( DB_MASTER );
+               $dbw = wfGetDB( DB_MASTER );
                $uid = $wgUser->getID();
                $log_id = $dbw->nextSequenceValue( 'log_log_id_seq' );
 
@@ -237,9 +237,8 @@ class LogPage {
         * @param object &$target A title object.
         * @param string $comment Description associated
         * @param array $params Parameters passed later to wfMsg.* functions
-        * @param Database $dbw, optional
         */
-       function addEntry( $action, $target, $comment, $params = array(), $dbw = NULL ) {
+       function addEntry( $action, $target, $comment, $params = array() ) {
                if ( !is_array( $params ) ) {
                        $params = array( $params );
                }
@@ -251,7 +250,7 @@ class LogPage {
 
                $this->actionText = LogPage::actionText( $this->type, $action, $target, NULL, $params );
 
-               return $this->saveContent( $dbw );
+               return $this->saveContent();
        }
 
        /**
index 20063c0..83eb23c 100644 (file)
@@ -365,8 +365,7 @@ class IPBlockForm {
                        # Make log entry, if the name is hidden, put it in the oversight log
                        $log_type = ($this->BlockHideName) ? 'suppress' : 'block';
                        $log = new LogPage( $log_type );
-                       $ok = $log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ),
-                         $reasonstr, $logParams, $dbw );
+                       $ok = $log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ), $reasonstr, $logParams );
                        # Make sure logging got through
                        if( !$ok ) {
                                $dbw->rollback();