Index: trunk/phase3/includes/cache/FileCacheBase.php |
— | — | @@ -116,12 +116,9 @@ |
117 | 117 | * @return string |
118 | 118 | */ |
119 | 119 | public function fetchText() { |
120 | | - if ( $this->useGzip() ) { |
121 | | - /* Why is there no gzfile_get_contents() or gzdecode()? */ |
122 | | - return implode( '', gzfile( $this->cachePath() ) ); |
123 | | - } else { |
124 | | - return file_get_contents( $this->cachePath() ); |
125 | | - } |
| 120 | + // gzopen can transparently read from gziped or plain text |
| 121 | + $fh = gzopen( $this->cachePath(), 'r' ); |
| 122 | + return stream_get_contents( $fh ); |
126 | 123 | } |
127 | 124 | |
128 | 125 | /** |
— | — | @@ -141,6 +138,7 @@ |
142 | 139 | |
143 | 140 | $this->checkCacheDirs(); // build parent dir |
144 | 141 | if ( !file_put_contents( $this->cachePath(), $text, LOCK_EX ) ) { |
| 142 | + wfDebug( __METHOD__ . "() failed saving ". $this->cachePath() . "\n"); |
145 | 143 | $this->mCached = null; |
146 | 144 | return false; |
147 | 145 | } |