"Tim Starling" posted a comment on MediaWiki.r98405.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/98405#c28398

Commit summary for MediaWiki.r98405:

HTMLFileCache refactoring:
* Rewrote class and split into three classes: a base class, and html cache and 
a more generic cache to be used later.
* The new classes now use RequestContext.
* Renamed fetchPageText() -> fetchText().
* Split out new saveText() function from saveToFileCache().
* Various other cleanups and fixes.
Also fixed backwards setting of $wgDisableCounters in rebuildFileCache.php.

Tim Starling's comment:

<pre>
/* Why is there no gzfile_get_contents() or gzdecode()? */
return implode( '', gzfile( $this->cachePath() ) );
</pre>

Not your code of course, but since you're claiming to have rewritten this 
class, I guess you get responsibility for this sort of thing. There is no 
gzdecode() in PHP 5.2, but there is readgzfile() which can be used with output 
buffering to get the file contents as a string without using large amounts of 
memory and CPU time by splitting it into an array. Alternatively gzopen() and a 
loop of gzread() can be used. gzopen() appears to return a stream resource, so 
stream_get_contents() would be another option.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to