if ( !is_string( $tmpDirectory ) ) {
$tmpDirectory = self::getUsableTempDirectory();
}
- $path = wfTempDir() . '/' . $prefix . $hex . $ext;
+ $path = $tmpDirectory . '/' . $prefix . $hex . $ext;
Wikimedia\suppressWarnings();
$newFileHandle = fopen( $path, 'x' );
Wikimedia\restoreWarnings();
* 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();