30 $this->handle = fopen( $file,
"wt" );
31 $this->filename = $file;
38 parent::writeCloseStream( $string );
39 if ( $this->handle ) {
40 fclose( $this->handle );
41 $this->handle =
false;
48 public function write( $string ) {
49 fputs( $this->handle, $string );
63 if ( !rename( $this->filename, $newname ) ) {
64 throw new RuntimeException( __METHOD__ .
": rename of file {$this->filename} to $newname failed\n" );
74 if ( is_array( $newname ) ) {
75 if ( count( $newname ) > 1 ) {
76 throw new MWException( __METHOD__ .
": passed multiple arguments for rename of single file\n" );
78 $newname = $newname[0];
89 if ( $this->handle ) {
90 fclose( $this->handle );
91 $this->handle =
false;
95 $this->handle = fopen( $this->filename,
"wt" );
109class_alias( DumpFileOutput::class,
'DumpFileOutput' );