r102901 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102900‎ | r102901 | r102902 >
Date:17:31, 13 November 2011
Author:nad
Status:deferred
Tags:
Comment:
use file_put_contents instead of fwrite
Modified paths:
  • /trunk/extensions/PdfBook/PdfBook.hooks.php (modified) (history)
  • /trunk/extensions/PdfBook/PdfBook.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PdfBook/PdfBook.php
@@ -16,7 +16,7 @@
1717 */
1818 if( !defined( 'MEDIAWIKI' ) ) die( "Not an entry point." );
1919
20 -define( 'PDFBOOK_VERSION', "1.0.10, 2011-11-08" );
 20+define( 'PDFBOOK_VERSION', "1.0.11, 2011-11-13" );
2121
2222 $dir = dirname( __FILE__ );
2323 $wgAutoloadClasses['PdfBookHooks'] = $dir . '/PdfBook.hooks.php';
Index: trunk/extensions/PdfBook/PdfBook.hooks.php
@@ -100,9 +100,7 @@
101101 else {
102102 # Write the HTML to a tmp file
103103 $file = "$wgUploadDirectory/" . uniqid( 'pdf-book' );
104 - $fh = fopen( $file, 'w+' );
105 - fwrite( $fh, $html );
106 - fclose( $fh );
 104+ file_put_contents( $file, $html );
107105
108106 $footer = $format == 'single' ? "..." : ".1.";
109107 $toc = $format == 'single' ? "" : " --toclevels $levels";

Status & tagging log