(bug 16923) New parameter value diff=review for the URL
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 7 Jan 2009 21:09:18 +0000 (21:09 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 7 Jan 2009 21:09:18 +0000 (21:09 +0000)
StartProfiler.php
docs/hooks.txt
includes/diff/DifferenceEngine.php

index 3fcf69e..6de8d52 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-require_once( dirname(__FILE__).'/includes/ProfilerStub.php' );
+require_once(  dirname(__FILE__).'/includes/Profiler.php' );
+$wgProfiler = new Profiler;
 
 /**
  * To use a profiler, delete the line above and add something like this:
index a6acdb6..6303711 100644 (file)
@@ -551,6 +551,13 @@ Return true to allow the normal editor to be used, or false
 if implementing a custom editor, e.g. for a special namespace,
 etc.
 
+'NewDifferenceEngine': Called when a new DifferenceEngine object is made
+$title: the diff page title (nullable)
+&$oldId: the actual old Id to use in the diff
+&$newId: the actual new Id to use in the diff (0 means current)
+$old: the ?old= param value from the url
+$new: the ?new= param value from the url
+
 'DiffViewHeader': called before diff display
 $diff: DifferenceEngine object that's calling
 $oldRev: Revision object of the "old" revision (may be null/invalid)
index b30ff19..b97fdce 100644 (file)
@@ -46,11 +46,8 @@ class DifferenceEngine {
                if ( 'prev' === $new ) {
                        # Show diff between revision $old and the previous one.
                        # Get previous one from DB.
-                       #
                        $this->mNewid = intval($old);
-
                        $this->mOldid = $this->mTitle->getPreviousRevisionID( $this->mNewid );
-
                } elseif ( 'next' === $new ) {
                        # Show diff between revision $old and the previous one.
                        # Get previous one from DB.
@@ -62,10 +59,10 @@ class DifferenceEngine {
                                # revision is cur, which is "0".
                                $this->mNewid = 0;
                        }
-
                } else {
                        $this->mOldid = intval($old);
                        $this->mNewid = intval($new);
+                       wfRunHooks( 'NewDifferenceEngine', array(&$titleObj, &$this->mOldid, &$this->mNewid, $old, $new) ); 
                }
                $this->mRcidMarkPatrolled = intval($rcid);  # force it to be an integer
                $this->mRefreshCache = $refreshCache;