if ( !is_string( $tmpDirectory ) ) {
$tmpDirectory = self::getUsableTempDirectory();
}
- $path = wfTempDir() . '/' . $prefix . $hex . $ext;
- MediaWiki\suppressWarnings();
+ $path = $tmpDirectory . '/' . $prefix . $hex . $ext;
+ Wikimedia\suppressWarnings();
$newFileHandle = fopen( $path, 'x' );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( $newFileHandle ) {
fclose( $newFileHandle );
$tmpFile = new self( $path );
*/
public function purge() {
$this->canDelete = false; // done
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$ok = unlink( $this->path );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
unset( self::$pathsCollect[$this->path] );
* This method should only be called internally
*/
public static function purgeAllOnShutdown() {
- foreach ( self::$pathsCollect as $path ) {
- MediaWiki\suppressWarnings();
+ foreach ( self::$pathsCollect as $path => $unused ) {
+ Wikimedia\suppressWarnings();
unlink( $path );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
}
}