39 $this->handle = fopen(
$file,
"wt" );
40 $this->filename =
$file;
47 parent::writeCloseStream( $string );
48 if ( $this->handle ) {
49 fclose( $this->handle );
50 $this->handle =
false;
58 fputs( $this->handle, $string );
73 if ( !rename( $this->filename, $newname ) ) {
74 throw new MWException( __METHOD__ .
": rename of file {$this->filename} to $newname failed\n" );
84 if ( is_array( $newname ) ) {
85 if ( count( $newname ) > 1 ) {
86 throw new MWException( __METHOD__ .
": passed multiple arguments for rename of single file\n" );
88 $newname = $newname[0];
100 if ( $this->handle ) {
101 fclose( $this->handle );
102 $this->handle =
false;
106 $this->handle = fopen( $this->filename,
"wt" );