Merge "Consolidate Title normalization code in SearchUpdate"
[lhc/web/wiklou.git] / includes / page / Article.php
index 56b9520..5d6435e 100644 (file)
@@ -379,7 +379,7 @@ class Article implements Page {
 
                # Pre-fill content with error message so that if something
                # fails we'll have something telling us what we intended.
-               //XXX: this isn't page content but a UI message. horrible.
+               // XXX: this isn't page content but a UI message. horrible.
                $this->mContentObject = new MessageContent( 'missing-revision', array( $oldid ) );
 
                if ( $oldid ) {
@@ -1075,7 +1075,6 @@ class Article implements Page {
 
                $outputPage = $this->getContext()->getOutput();
                $user = $this->getContext()->getUser();
-               $cache = wfGetMainCache();
                $rc = false;
 
                if ( !$this->getTitle()->quickUserCan( 'patrol', $user )
@@ -1100,7 +1099,8 @@ class Article implements Page {
                }
 
                // Check for cached results
-               $key = wfMemcKey( 'NotPatrollablePage', $this->getTitle()->getArticleID() );
+               $key = wfMemcKey( 'unpatrollable-page', $this->getTitle()->getArticleID() );
+               $cache = ObjectCache::getMainWANInstance();
                if ( $cache->get( $key ) ) {
                        return false;
                }
@@ -1124,8 +1124,7 @@ class Article implements Page {
                                        'rc_namespace' => $this->getTitle()->getNamespace(),
                                        'rc_cur_id' => $this->getTitle()->getArticleID()
                                ),
-                               __METHOD__,
-                               array( 'USE INDEX' => 'new_name_timestamp' )
+                               __METHOD__
                        );
                } else {
                        // Cache the information we gathered above in case we can't patrol
@@ -1937,7 +1936,7 @@ class Article implements Page {
         * @return ParserOutput|bool ParserOutput or false if the given revision ID is not found
         */
        public function getParserOutput( $oldid = null, User $user = null ) {
-               //XXX: bypasses mParserOptions and thus setParserOptions()
+               // XXX: bypasses mParserOptions and thus setParserOptions()
 
                if ( $user === null ) {
                        $parserOptions = $this->getParserOptions();
@@ -2010,7 +2009,7 @@ class Article implements Page {
         */
        public function __get( $fname ) {
                if ( property_exists( $this->mPage, $fname ) ) {
-                       #wfWarn( "Access to raw $fname field " . __CLASS__ );
+                       # wfWarn( "Access to raw $fname field " . __CLASS__ );
                        return $this->mPage->$fname;
                }
                trigger_error( 'Inaccessible property via __get(): ' . $fname, E_USER_NOTICE );
@@ -2025,7 +2024,7 @@ class Article implements Page {
         */
        public function __set( $fname, $fvalue ) {
                if ( property_exists( $this->mPage, $fname ) ) {
-                       #wfWarn( "Access to raw $fname field of " . __CLASS__ );
+                       # wfWarn( "Access to raw $fname field of " . __CLASS__ );
                        $this->mPage->$fname = $fvalue;
                // Note: extensions may want to toss on new fields
                } elseif ( !in_array( $fname, array( 'mContext', 'mPage' ) ) ) {
@@ -2045,7 +2044,7 @@ class Article implements Page {
         */
        public function __call( $fname, $args ) {
                if ( is_callable( array( $this->mPage, $fname ) ) ) {
-                       #wfWarn( "Call to " . __CLASS__ . "::$fname; please use WikiPage instead" );
+                       # wfWarn( "Call to " . __CLASS__ . "::$fname; please use WikiPage instead" );
                        return call_user_func_array( array( $this->mPage, $fname ), $args );
                }
                trigger_error( 'Inaccessible function via __call(): ' . $fname, E_USER_ERROR );
@@ -2089,15 +2088,15 @@ class Article implements Page {
        /**
         * @param string $reason
         * @param bool $suppress
-        * @param int $id
-        * @param bool $commit
+        * @param int $u1 Unused
+        * @param bool $u2 Unused
         * @param string $error
         * @return bool
         */
-       public function doDeleteArticle( $reason, $suppress = false, $id = 0,
-               $commit = true, &$error = ''
+       public function doDeleteArticle(
+               $reason, $suppress = false, $u1 = null, $u2 = null, &$error = ''
        ) {
-               return $this->mPage->doDeleteArticle( $reason, $suppress, $id, $commit, $error );
+               return $this->mPage->doDeleteArticle( $reason, $suppress, $u1, $u2, $error );
        }
 
        /**