Update mediawiki/mediawiki-codesniffer to 0.7.1
[lhc/web/wiklou.git] / includes / skins / Skin.php
index 63b6978..d70a6b9 100644 (file)
@@ -81,15 +81,6 @@ abstract class Skin extends ContextSource {
                return $allowedSkins;
        }
 
-       /**
-        * @deprecated since 1.23, use getAllowedSkins
-        * @return string[]
-        */
-       public static function getUsableSkins() {
-               wfDeprecated( __METHOD__, '1.23' );
-               return self::getAllowedSkins();
-       }
-
        /**
         * Normalize a skin preference value to a form that can be loaded.
         *
@@ -140,23 +131,6 @@ abstract class Skin extends ContextSource {
                }
        }
 
-       /**
-        * Factory method for loading a skin of a given type
-        * @param string $key 'monobook', 'vector', etc.
-        * @return Skin
-        * @deprecated since 1.24; Use SkinFactory instead
-        */
-       static function &newFromKey( $key ) {
-               wfDeprecated( __METHOD__, '1.24' );
-
-               $key = Skin::normalizeKey( $key );
-               $factory = SkinFactory::getDefaultInstance();
-
-               // normalizeKey() guarantees that a skin with this key will exist.
-               $skin = $factory->makeSkin( $key );
-               return $skin;
-       }
-
        /**
         * @return string Skin name
         */
@@ -413,8 +387,9 @@ abstract class Skin extends ContextSource {
                }
 
                $name = Sanitizer::escapeClass( 'page-' . $title->getPrefixedText() );
+               $root = Sanitizer::escapeClass( 'rootpage-' . $title->getRootTitle()->getPrefixedText() );
 
-               return "$numeric $type $name";
+               return "$numeric $type $name $root";
        }
 
        /**
@@ -1024,21 +999,6 @@ abstract class Skin extends ContextSource {
                        $targetUser->canReceiveEmail();
        }
 
-       /**
-        * This function previously returned a fully resolved style path URL to images or styles stored in
-        * the legacy skins/common/ directory.
-        *
-        * That directory has been removed in 1.24 and the function always returns an empty string.
-        *
-        * @deprecated since 1.24
-        * @param string $name The name or path of a skin resource file
-        * @return string Empty string
-        */
-       function getCommonStylePath( $name ) {
-               wfDeprecated( __METHOD__, '1.24' );
-               return '';
-       }
-
        /**
         * Return a fully resolved style path url to images or styles stored in the current skins's folder.
         * This method returns a url resolved using the configured skin style path
@@ -1240,7 +1200,9 @@ abstract class Skin extends ContextSource {
                        $cache = ObjectCache::getMainWANInstance();
                        $sidebar = $cache->getWithSetCallback(
                                $cache->makeKey( 'sidebar', $this->getLanguage()->getCode() ),
-                               $wgSidebarCacheExpiry,
+                               MessageCache::singleton()->isDisabled()
+                                       ? $cache::TTL_UNCACHEABLE // bug T133069
+                                       : $wgSidebarCacheExpiry,
                                $callback,
                                [ 'lockTSE' => 30 ]
                        );
@@ -1601,24 +1563,56 @@ abstract class Skin extends ContextSource {
                return $result;
        }
 
-       /**
-        * Use PHP's magic __call handler to intercept legacy calls to the linker
-        * for backwards compatibility.
-        *
-        * @param string $fname Name of called method
-        * @param array $args Arguments to the method
-        * @throws MWException
-        * @return mixed
-        */
-       function __call( $fname, $args ) {
-               $realFunction = [ 'Linker', $fname ];
-               if ( is_callable( $realFunction ) ) {
-                       wfDeprecated( get_class( $this ) . '::' . $fname, '1.21' );
-                       return call_user_func_array( $realFunction, $args );
-               } else {
-                       $className = get_class( $this );
-                       throw new MWException( "Call to undefined method $className::$fname" );
-               }
+       /** @deprecated in 1.21 */
+       public function commentBlock( $comment, $title = null, $local = false, $wikiId = null ) {
+               wfDeprecated( __METHOD__, '1.21' );
+               return Linker::commentBlock( $comment, $title, $local, $wikiId );
+       }
+
+       /** @deprecated in 1.21 */
+       public function generateRollback(
+               $rev,
+               IContextSource $context = null,
+               $options = [ 'verify' ]
+       ) {
+               wfDeprecated( __METHOD__, '1.21' );
+               return Linker::generateRollback( $rev, $context, $options );
+       }
+
+       /** @deprecated in 1.21 */
+       public function link( $target, $html = null, $customAttribs = [], $query = [], $options = [] ) {
+               wfDeprecated( __METHOD__, '1.21' );
+               return Linker::link( $target, $html, $customAttribs, $query, $options );
+       }
+
+       /** @deprecated in 1.21 */
+       public function linkKnown(
+               $target,
+               $html = null,
+               $customAttribs = [],
+               $query = [],
+               $options = [ 'known', 'noclasses' ]
+       ) {
+               wfDeprecated( __METHOD__, '1.21' );
+               return Linker::linkKnown( $target, $html, $customAttribs, $query, $options );
+       }
+
+       /** @deprecated in 1.21 */
+       public function userLink( $userId, $userName, $altUserName = false ) {
+               wfDeprecated( __METHOD__, '1.21' );
+               return Linker::userLink( $userId, $userName, $altUserName );
+       }
+
+       /** @deprecated in 1.21 */
+       public function userToolLinks(
+               $userId,
+               $userText,
+               $redContribsWhenNoEdits = false,
+               $flags = 0,
+               $edits = null
+       ) {
+               wfDeprecated( __METHOD__, '1.21' );
+               return Linker::userToolLinks( $userId, $userText, $redContribsWhenNoEdits, $flags, $edits );
        }
 
 }