Also set the queue types map when rebuilding the ready queue map
[lhc/web/wiklou.git] / includes / Revision.php
index 7b30540..06f5bd0 100644 (file)
@@ -134,8 +134,8 @@ class Revision implements IDBAccessObject {
         *      Revision::READ_LATEST  : Select the data from the master (since 1.20)
         *      Revision::READ_LOCKING : Select & lock the data from the master
         *
-        * @param int $revId
-        * @param int $pageId (optional)
+        * @param int $pageId
+        * @param int $revId (optional)
         * @param int $flags Bitfield (optional)
         * @return Revision|null
         */
@@ -444,6 +444,7 @@ class Revision implements IDBAccessObject {
                        'ar_id',
                        'ar_page_id',
                        'ar_rev_id',
+                       'ar_text',
                        'ar_text_id',
                        'ar_timestamp',
                        'ar_comment',
@@ -524,7 +525,7 @@ class Revision implements IDBAccessObject {
        /**
         * Constructor
         *
-        * @param object $row Either a database row or an array
+        * @param object|array $row Either a database row or an array
         * @throws MWException
         * @access private
         */
@@ -1201,18 +1202,18 @@ class Revision implements IDBAccessObject {
        }
 
        /**
-         * Get revision text associated with an old or archive row
-         * $row is usually an object from wfFetchRow(), both the flags and the text
-         * field must be included.
-         *
-         * @param stdClass $row The text data
-         * @param string $prefix Table prefix (default 'old_')
-         * @param string|bool $wiki The name of the wiki to load the revision text from
-         *   (same as the the wiki $row was loaded from) or false to indicate the local
-         *   wiki (this is the default). Otherwise, it must be a symbolic wiki database
-         *   identifier as understood by the LoadBalancer class.
-         * @return string Text the text requested or false on failure
-         */
+        * Get revision text associated with an old or archive row
+        * $row is usually an object from wfFetchRow(), both the flags and the text
+        * field must be included.
+        *
+        * @param stdClass $row The text data
+        * @param string $prefix Table prefix (default 'old_')
+        * @param string|bool $wiki The name of the wiki to load the revision text from
+        *   (same as the the wiki $row was loaded from) or false to indicate the local
+        *   wiki (this is the default). Otherwise, it must be a symbolic wiki database
+        *   identifier as understood by the LoadBalancer class.
+        * @return string Text the text requested or false on failure
+        */
        public static function getRevisionText( $row, $prefix = 'old_', $wiki = false ) {
                wfProfileIn( __METHOD__ );
 
@@ -1566,9 +1567,10 @@ class Revision implements IDBAccessObject {
         * @param int $pageId: ID number of the page to read from
         * @param string $summary Revision's summary
         * @param bool $minor Whether the revision should be considered as minor
+        * @param User|null $user User object to use or null for $wgUser
         * @return Revision|null Revision or null on error
         */
-       public static function newNullRevision( $dbw, $pageId, $summary, $minor ) {
+       public static function newNullRevision( $dbw, $pageId, $summary, $minor, $user = null ) {
                global $wgContentHandlerUseDB;
 
                wfProfileIn( __METHOD__ );
@@ -1591,8 +1593,15 @@ class Revision implements IDBAccessObject {
                        __METHOD__ );
 
                if ( $current ) {
+                       if ( !$user ) {
+                               global $wgUser;
+                               $user = $wgUser;
+                       }
+
                        $row = array(
                                'page'       => $pageId,
+                               'user_text'  => $user->getName(),
+                               'user'       => $user->getId(),
                                'comment'    => $summary,
                                'minor_edit' => $minor,
                                'text_id'    => $current->rev_text_id,
@@ -1723,6 +1732,7 @@ class Revision implements IDBAccessObject {
         * 50 revisions for the sake of performance.
         *
         * @since 1.20
+        * @deprecated since 1.24
         *
         * @param DatabaseBase|int $db The Database to perform the check on. May be given as a
         *        Database object or a database identifier usable with wfGetDB.