Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/215384

Change subject: resourceloader: Remove redundant getModifiedTime implementation
......................................................................

resourceloader: Remove redundant getModifiedTime implementation

Follows-up f37cee996e which replaced the getHashMtime() and
getDefinitionMtime() methods with dummies that always return 1.

These getModifiedTime() implementation was only tracking the
definition, which is already tracked by getVersionHash().

Change-Id: I6e37c3c2f85ef4599a8643b0efabc18de2f51ec4
---
M includes/ResourceLoaderSchemaModule.php
1 file changed, 2 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging 
refs/changes/84/215384/1

diff --git a/includes/ResourceLoaderSchemaModule.php 
b/includes/ResourceLoaderSchemaModule.php
index 29025d8..29d06cf 100644
--- a/includes/ResourceLoaderSchemaModule.php
+++ b/includes/ResourceLoaderSchemaModule.php
@@ -19,7 +19,6 @@
        /** @var RemoteSchema $schema **/
        public $schema;
 
-
        /**
         * Constructor; invoked by ResourceLoader.
         * Ensures that the 'schema' and 'revision' keys were set on the
@@ -55,33 +54,13 @@
                $this->targets = array( 'desktop', 'mobile' );
        }
 
-
        /**
         * Part of the ResourceLoader module interface.
         * Declares the core ext.eventLogging module as a dependency.
         * @return array: Module names.
         */
-       function getDependencies() {
+       public function getDependencies() {
                return array( 'ext.eventLogging' );
-       }
-
-
-       /**
-        * Get the last modified timestamp of this module.
-        *
-        * The last modified timestamp controls caching. Because revisions are
-        * immutable, we don't need to fetch the RemoteSchema, nor get the 
revision's
-        * timestamp. We simply hash our module definition.
-        *
-        * @param ResourceLoaderContext $context
-        * @return integer: Unix timestamp.
-        */
-       function getModifiedTime( ResourceLoaderContext $context ) {
-               if ( !$this->schema->get() ) {
-                       // If we failed to fetch, hold off on rolling over 
definition timestamp
-                       return 1;
-               }
-               return $this->getDefinitionMtime( $context );
        }
 
        /**
@@ -98,7 +77,6 @@
                return $summary;
        }
 
-
        /**
         * Generates JavaScript module code from schema.
         * Retrieves a schema and generates a JavaScript expression which,
@@ -107,7 +85,7 @@
         * @param ResourceLoaderContext $context
         * @return string: JavaScript code.
         */
-       function getScript( ResourceLoaderContext $context ) {
+       public function getScript( ResourceLoaderContext $context ) {
                $schema = $this->schema->jsonSerialize();
                efStripKeyRecursive( $schema, 'description' );
                $params = array( $this->schema->title, $schema );

-- 
To view, visit https://gerrit.wikimedia.org/r/215384
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e37c3c2f85ef4599a8643b0efabc18de2f51ec4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to