Index: trunk/extensions/CodeReview/CodeRepository.php |
— | — | @@ -196,6 +196,12 @@ |
197 | 197 | } else { |
198 | 198 | $data = $wgMemc->get( $key ); |
199 | 199 | } |
| 200 | + |
| 201 | + // Try DB cache...this is used by daemonds |
| 202 | + if ( !$data && $useCache != 'skipcache' ) { |
| 203 | + $dbCache = wfGetCache( CACHE_DB ); |
| 204 | + $data = $dbCache->get( $key ); |
| 205 | + } |
200 | 206 | |
201 | 207 | # Try the database... |
202 | 208 | if ( !$data && $useCache != 'skipcache' ) { |
— | — | @@ -223,7 +229,12 @@ |
224 | 230 | $svn = SubversionAdaptor::newFromRepo( $this->mPath ); |
225 | 231 | $data = $svn->getDiff( '', $rev1, $rev2 ); |
226 | 232 | // Store to cache |
227 | | - $wgMemc->set( $key, $data, 3600 * 24 * 3 ); |
| 233 | + if( php_sapi_name() != 'cli' ) { |
| 234 | + $wgMemc->set( $key, $data, 3600 * 24 * 3 ); |
| 235 | + } else { |
| 236 | + $dbCache = wfGetCache( CACHE_DB ); // memcache fails in cli mode |
| 237 | + $dbCache->set( $key, $data, 3600 * 24 * 3 ); |
| 238 | + } |
228 | 239 | // Permanent DB storage |
229 | 240 | $storedData = $data; |
230 | 241 | $flags = Revision::compressRevisionText( $storedData ); |