resourceloader: Use upsert() instead of replace() for module_deps write
[lhc/web/wiklou.git] / includes / Revision.php
index b812191..d9e42ff 100644 (file)
@@ -874,7 +874,7 @@ class Revision implements IDBAccessObject {
        /**
         * Fetch revision's user id without regard for the current user's permissions
         *
-        * @return string
+        * @return int
         * @deprecated since 1.25, use getUser( Revision::RAW )
         */
        public function getRawUser() {
@@ -1035,28 +1035,6 @@ class Revision implements IDBAccessObject {
                return (int)$this->mDeleted;
        }
 
-       /**
-        * Fetch revision text if it's available to the specified audience.
-        * If the specified audience does not have the ability to view this
-        * revision, an empty string will be returned.
-        *
-        * @param int $audience One of:
-        *   Revision::FOR_PUBLIC       to be displayed to all users
-        *   Revision::FOR_THIS_USER    to be displayed to the given user
-        *   Revision::RAW              get the text regardless of permissions
-        * @param User $user User object to check for, only if FOR_THIS_USER is passed
-        *   to the $audience parameter
-        *
-        * @deprecated since 1.21, use getContent() instead
-        * @return string
-        */
-       public function getText( $audience = self::FOR_PUBLIC, User $user = null ) {
-               wfDeprecated( __METHOD__, '1.21' );
-
-               $content = $this->getContent( $audience, $user );
-               return ContentHandler::getContentText( $content ); # returns the raw content text, if applicable
-       }
-
        /**
         * Fetch revision content if it's available to the specified audience.
         * If the specified audience does not have the ability to view this
@@ -1131,7 +1109,7 @@ class Revision implements IDBAccessObject {
         *
         * @return string The content model id associated with this revision,
         *     see the CONTENT_MODEL_XXX constants.
-        **/
+        */
        public function getContentModel() {
                if ( !$this->mContentModel ) {
                        $title = $this->getTitle();
@@ -1155,7 +1133,7 @@ class Revision implements IDBAccessObject {
         *
         * @return string The content format id associated with this revision,
         *     see the CONTENT_FORMAT_XXX constants.
-        **/
+        */
        public function getContentFormat() {
                if ( !$this->mContentFormat ) {
                        $handler = $this->getContentHandler();
@@ -1269,7 +1247,7 @@ class Revision implements IDBAccessObject {
         *   (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
+        * @return string|false Text the text requested or false on failure
         */
        public static function getRevisionText( $row, $prefix = 'old_', $wiki = false ) {
 
@@ -1505,7 +1483,9 @@ class Revision implements IDBAccessObject {
                        );
                }
 
-               Hooks::run( 'RevisionInsertComplete', [ &$this, $data, $flags ] );
+               // Avoid PHP 7.1 warning of passing $this by reference
+               $revision = $this;
+               Hooks::run( 'RevisionInsertComplete', [ &$revision, $data, $flags ] );
 
                return $this->mId;
        }