Revert r34906, r34907, r34928 -- mixing high-level data into low-level storage functi...
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 17 May 2008 15:53:58 +0000 (15:53 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 17 May 2008 15:53:58 +0000 (15:53 +0000)
docs/hooks.txt
includes/Article.php
includes/Revision.php
includes/SpecialImport.php
includes/SpecialUndelete.php
includes/Title.php
includes/filerepo/ICRepo.php
includes/filerepo/LocalFile.php

index 944b952..70ff967 100644 (file)
@@ -929,8 +929,6 @@ $user: the User object to load preferences from
 
 'RevisionInsertComplete': called after a revision is inserted into the DB
 $revision: the Revision
-$edit: was this a new edit?
-$baseID: what revision ID was this revision based off? (false if none)
 
 'SavePreferences': called at the end of PreferencesForm::savePreferences; 
                    returning false prevents the preferences from being saved.
index 3192009..cef4470 100644 (file)
@@ -1362,11 +1362,10 @@ class Article {
         * EDIT_NEW is specified and the article does exist, a duplicate key error will cause an exception
         * to be thrown from the Database. These two conditions are also possible with auto-detection due
         * to MediaWiki's performance-optimised locking strategy.
-        * @param integer $baseRevID, the revision ID this is based off
         *
         * @return bool success
         */
-       function doEdit( $text, $summary, $flags = 0, $baseRevID = false ) {
+       function doEdit( $text, $summary, $flags = 0 ) {
                global $wgUser, $wgDBtransactions;
 
                wfProfileIn( __METHOD__ );
@@ -1445,7 +1444,7 @@ class Article {
                                        ) );
 
                                $dbw->begin();
-                               $revisionId = $revision->insertOn( $dbw, true, $baseRevID );
+                               $revisionId = $revision->insertOn( $dbw );
 
                                # Update page
                                $ok = $this->updateRevisionOn( $dbw, $revision, $lastRevision );
@@ -1513,7 +1512,7 @@ class Article {
                                'minor_edit' => $isminor,
                                'text'       => $text
                                ) );
-                       $revisionId = $revision->insertOn( $dbw, true );
+                       $revisionId = $revision->insertOn( $dbw );
 
                        $this->mTitle->resetArticleID( $newid );
 
@@ -2525,7 +2524,7 @@ class Article {
 
                if( $bot && ($wgUser->isAllowed('markbotedits') || $wgUser->isAllowed('bot')) )
                        $flags |= EDIT_FORCE_BOT;
-               $this->doEdit( $target->getText(), $summary, $flags, $target->getId() );
+               $this->doEdit( $target->getText(), $summary, $flags );
 
                wfRunHooks( 'ArticleRollbackComplete', array( $this, $wgUser, $target ) );
 
index 050db2b..a6f9604 100644 (file)
@@ -707,11 +707,9 @@ class Revision {
         * number on success and dies horribly on failure.
         *
         * @param Database $dbw
-        * @param bool $edit, was this a new edit? (optional)
-        * @param integer $baseID, what revision was this based on? (optional)
         * @return int
         */
-       public function insertOn( &$dbw, $edit = false, $baseID = false ) {
+       public function insertOn( &$dbw ) {
                global $wgDefaultExternalStore;
 
                wfProfileIn( __METHOD__ );
@@ -774,7 +772,7 @@ class Revision {
 
                $this->mId = !is_null($rev_id) ? $rev_id : $dbw->insertId();
                
-               wfRunHooks( 'RevisionInsertComplete', array( &$this, $edit, $baseID ) );
+               wfRunHooks( 'RevisionInsertComplete', array( &$this ) );
                
                wfProfileOut( __METHOD__ );
                return $this->mId;
index da7a766..76bd646 100644 (file)
@@ -218,7 +218,7 @@ class ImportReporter {
                        $dbw = wfGetDB( DB_MASTER );
                        $nullRevision = Revision::newNullRevision(
                                $dbw, $title->getArticleId(), $comment, true );
-                       $nullRevision->insertOn( $dbw, true );
+                       $nullRevision->insertOn( $dbw );
                        # Update page record
                        $article = new Article( $title );
                        $article->updateRevisionOn( $dbw, $nullRevision );
index a98e71e..c0e2e0c 100644 (file)
@@ -514,7 +514,7 @@ class PageArchive {
                                'deleted'        => $unsuppress ? 0 : $row->ar_deleted,
                                'len'        => $row->ar_len
                                ) );
-                       $revision->insertOn( $dbw, false );
+                       $revision->insertOn( $dbw );
                        $restored++;
 
                        wfRunHooks( 'ArticleRevisionUndeleted', array( &$this->title, $revision, $row->ar_page_id ) );
index 89e20b0..fbbbc79 100644 (file)
@@ -2598,7 +2598,7 @@ class Title {
 
                # Save a null revision in the page's history notifying of the move
                $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true );
-               $nullRevId = $nullRevision->insertOn( $dbw, true );
+               $nullRevId = $nullRevision->insertOn( $dbw );
 
                # Change the name of the target page:
                $dbw->update( 'page',
@@ -2624,7 +2624,7 @@ class Title {
                                'page'    => $newid,
                                'comment' => $comment,
                                'text'    => $redirectText ) );
-                       $redirectRevision->insertOn( $dbw, true );
+                       $redirectRevision->insertOn( $dbw );
                        $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 );
 
                        # Now, we record the link from the redirect to the new title.
@@ -2685,7 +2685,7 @@ class Title {
 
                # Save a null revision in the page's history notifying of the move
                $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true );
-               $nullRevId = $nullRevision->insertOn( $dbw, true );
+               $nullRevId = $nullRevision->insertOn( $dbw );
 
                # Rename page entry
                $dbw->update( 'page',
@@ -2711,7 +2711,7 @@ class Title {
                                'page'    => $newid,
                                'comment' => $comment,
                                'text'    => $redirectText ) );
-                       $redirectRevision->insertOn( $dbw, true );
+                       $redirectRevision->insertOn( $dbw );
                        $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 );
 
                        # Record the just-created redirect's linking to the page
index 9f2cc71..805dc02 100644 (file)
@@ -285,7 +285,7 @@ class ICFile extends LocalFile{
                if( $descTitle->exists() ) {
                        # Create a null revision
                        $nullRevision = Revision::newNullRevision( $dbw, $descTitle->getArticleId(), $log->getRcComment(), false );
-                       $nullRevision->insertOn( $dbw, true );
+                       $nullRevision->insertOn( $dbw );
                        $article->updateRevisionOn( $dbw, $nullRevision );
 
                        # Invalidate the cache for the description page
index d341290..f96d171 100644 (file)
@@ -858,7 +858,7 @@ class LocalFile extends File
                if( $descTitle->exists() ) {
                        # Create a null revision
                        $nullRevision = Revision::newNullRevision( $dbw, $descTitle->getArticleId(), $log->getRcComment(), false );
-                       $nullRevision->insertOn( $dbw, true );
+                       $nullRevision->insertOn( $dbw );
                        $article->updateRevisionOn( $dbw, $nullRevision );
 
                        # Invalidate the cache for the description page