Mass conversion of $wgContLang to service
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderModule.php
index a0a4e58..3bf309d 100644 (file)
@@ -129,9 +129,8 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * @return bool
         */
        public function getFlip( $context ) {
-               global $wgContLang;
-
-               return $wgContLang->getDir() !== $context->getDirection();
+               return MediaWikiServices::getInstance()->getContentLanguage()->getDir() !==
+                       $context->getDirection();
        }
 
        /**
@@ -347,7 +346,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * Note: It is expected that $context will be made non-optional in the near
         * future.
         *
-        * @param ResourceLoaderContext $context
+        * @param ResourceLoaderContext|null $context
         * @return array List of module names as strings
         */
        public function getDependencies( ResourceLoaderContext $context = null ) {
@@ -799,11 +798,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * This method should be quick because it is frequently run by ResourceLoaderStartUpModule to
         * propagate changes to the client and effectively invalidate cache.
         *
-        * For backward-compatibility, the following optional data providers are automatically included:
-        *
-        * - getModifiedTime()
-        * - getModifiedHash()
-        *
         * @since 1.26
         * @param ResourceLoaderContext $context
         * @return string Hash (should use ResourceLoader::makeHash)
@@ -833,18 +827,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                                        throw new LogicException( 'getDefinitionSummary must call parent method' );
                                }
                                $str = json_encode( $summary );
-
-                               $mtime = $this->getModifiedTime( $context );
-                               if ( $mtime !== null ) {
-                                       // Support: MediaWiki 1.25 and earlier
-                                       $str .= strval( $mtime );
-                               }
-
-                               $mhash = $this->getModifiedHash( $context );
-                               if ( $mhash !== null ) {
-                                       // Support: MediaWiki 1.25 and earlier
-                                       $str .= strval( $mhash );
-                               }
                        }
 
                        $this->versionHash[$contextHash] = ResourceLoader::makeHash( $str );
@@ -915,28 +897,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                ];
        }
 
-       /**
-        * Get this module's last modification timestamp for a given context.
-        *
-        * @deprecated since 1.26 Use getDefinitionSummary() instead
-        * @param ResourceLoaderContext $context
-        * @return int|null UNIX timestamp
-        */
-       public function getModifiedTime( ResourceLoaderContext $context ) {
-               return null;
-       }
-
-       /**
-        * Helper method for providing a version hash to getVersionHash().
-        *
-        * @deprecated since 1.26 Use getDefinitionSummary() instead
-        * @param ResourceLoaderContext $context
-        * @return string|null Hash
-        */
-       public function getModifiedHash( ResourceLoaderContext $context ) {
-               return null;
-       }
-
        /**
         * Check whether this module is known to be empty. If a child class
         * has an easy and cheap way to determine that this module is