[FileBackend] Bumped Swift listing page size.
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderWikiModule.php
index fbb3fb1..9dd6939 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 /**
+ * Abstraction for resource loader modules which pull from wiki pages.
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * @author Roan Kattouw
  */
 
-defined( 'MEDIAWIKI' ) || die( 1 );
-
 /**
  * Abstraction for resource loader modules which pull from wiki pages
  *
  * This can only be used for wiki pages in the MediaWiki and User namespaces,
  * because of its dependence on the functionality of
- * Title::isValidCssJsSubpage.
+ * Title::isCssJsSubpage.
  */
 abstract class ResourceLoaderWikiModule extends ResourceLoaderModule {
 
@@ -42,7 +42,6 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule {
        /* Abstract Protected Methods */
 
        /**
-        * @abstract
         * @param $context ResourceLoaderContext
         */
        abstract protected function getPages( ResourceLoaderContext $context );
@@ -70,8 +69,10 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule {
         */
        protected function getContent( $title ) {
                if ( $title->getNamespace() === NS_MEDIAWIKI ) {
-                       $message = wfMessage( $title->getDBkey() )->inContentLanguage();
-                       return $message->exists() ? $message->plain() : '';
+                       // The first "true" is to use the database, the second is to use the content langue
+                       // and the last one is to specify the message key already contains the language in it ("/de", etc.)
+                       $text = MessageCache::singleton()->get( $title->getDBkey(), true, true, true );
+                       return $text === false ? '' : $text;
                }
                if ( !$title->isCssJsSubpage() && !$title->isCssOrJsPage() ) {
                        return null;
@@ -157,6 +158,7 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule {
                if ( count( $mtimes ) ) {
                        $modifiedTime = max( $modifiedTime, max( $mtimes ) );
                }
+               $modifiedTime = max( $modifiedTime, $this->getMsgBlobMtime( $context->getLanguage() ) );
                return $modifiedTime;
        }