From: Timo Tijhof Date: Sat, 4 May 2019 20:04:58 +0000 (+0100) Subject: filebackend: Restore TempFSFile shutdown-purge functionality X-Git-Tag: 1.34.0-rc.0~1787^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=a90cf1fb8cb3a005585db14f300e5a05bccc3954;p=lhc%2Fweb%2Fwiklou.git filebackend: Restore TempFSFile shutdown-purge functionality Introduced in 603d8970c3575 to handle purging of tmp files in case of fatals and other ways that the PHP process can exit in a way that (some) destructors might not run, but shutdown callbacks do. It did not appear to work as it looped over the array values, which are all int(1), instead of the array keys. Change-Id: I83f0c8ea15e2bfb2bdc9aa2b4015635771abe394 --- diff --git a/includes/libs/filebackend/fsfile/TempFSFile.php b/includes/libs/filebackend/fsfile/TempFSFile.php index 321424f94b..b993626fda 100644 --- a/includes/libs/filebackend/fsfile/TempFSFile.php +++ b/includes/libs/filebackend/fsfile/TempFSFile.php @@ -178,7 +178,7 @@ class TempFSFile extends FSFile { * This method should only be called internally */ public static function purgeAllOnShutdown() { - foreach ( self::$pathsCollect as $path ) { + foreach ( self::$pathsCollect as $path => $unused ) { Wikimedia\suppressWarnings(); unlink( $path ); Wikimedia\restoreWarnings();