31 $ext = ( $extension !=
'' ) ?
".{$extension}" :
'';
32 $tmpDirectory = $this->tmpDirectory;
33 if ( !is_string( $tmpDirectory ) ) {
38 while ( $attempts-- ) {
39 $hex = sprintf(
'%06x%06x', mt_rand( 0, 0xffffff ), mt_rand( 0, 0xffffff ) );
40 $path =
"$tmpDirectory/$prefix$hex$ext";
41 AtEase::suppressWarnings();
42 $newFileHandle = fopen(
$path,
'x' );
43 AtEase::restoreWarnings();
44 if ( $newFileHandle ) {
45 fclose( $newFileHandle );
47 $tmpFile->autocollect();