From 62d8fc872b6cfa20f57816e0a30379d4f5bd3b36 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Thu, 7 Jun 2018 14:21:53 +0200 Subject: [PATCH] registration: Allow the mtime of extension.json files to be zero When creating Docker images of MediaWiki using the Bazel build system, I noticed that I'm not able to load any extensions. This is due to the fact that Bazel always generates container layers with mtimes of files set to 1970-01-01 for determinism/reproducibility. Relax the check a bit to only fail when the mtime is false, which happens when filemtime() fails. Bug: T196672 Change-Id: Ieaeb3113a7d9c44f29cca2d062c5bb11ebeada0d (cherry picked from commit d7d5d3c82a84338bd2669284427193ea7a80bdbc) --- includes/registration/ExtensionRegistry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index 0eb6a9bb7f..aae5fc2824 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -107,7 +107,7 @@ class ExtensionRegistry { throw new Exception( "$path does not exist!" ); } // @codeCoverageIgnoreStart - if ( !$mtime ) { + if ( $mtime === false ) { $err = error_get_last(); throw new Exception( "Couldn't stat $path: {$err['message']}" ); // @codeCoverageIgnoreEnd -- 2.20.1