- // If a module is nothing but a list of dependencies, we need to avoid
- // giving max() an empty array
- if ( count( $files ) === 0 ) {
- $this->modifiedTime[$context->getHash()] = 1;
- return $this->modifiedTime[$context->getHash()];
- }
-
- $filesMtime = max( array_map( array( __CLASS__, 'safeFilemtime' ), $files ) );
-
- $this->modifiedTime[$context->getHash()] = max(
- $filesMtime,
- $this->getMsgBlobMtime( $context->getLanguage() ),
- $this->getDefinitionMtime( $context )
- );
-
- return $this->modifiedTime[$context->getHash()];
+ // Don't max() because older files are significant.
+ // While the associated file names are significant, that is already taken care of by the
+ // definition summary. Avoid creating an array keyed by file path here because those are
+ // absolute file paths. Including that would needlessly cause global cache invalidation
+ // when the MediaWiki installation path changes (which is quite common in cases like
+ // Wikimedia where the installation path reflects the MediaWiki branch name).
+ return array_map( array( __CLASS__, 'safeFilemtime' ), $files );