Index: trunk/phase3/includes/BagOStuff.php |
— | — | @@ -253,6 +253,9 @@ |
254 | 254 | } |
255 | 255 | |
256 | 256 | function set($key,$value,$exptime=0) { |
| 257 | + if ( wfReadOnly() ) { |
| 258 | + return false; |
| 259 | + } |
257 | 260 | $exptime = intval($exptime); |
258 | 261 | if($exptime < 0) $exptime = 0; |
259 | 262 | if($exptime == 0) { |
— | — | @@ -272,6 +275,9 @@ |
273 | 276 | } |
274 | 277 | |
275 | 278 | function delete($key,$time=0) { |
| 279 | + if ( wfReadOnly() ) { |
| 280 | + return false; |
| 281 | + } |
276 | 282 | $this->_query( |
277 | 283 | "DELETE FROM $0 WHERE keyname='$1'", $key ); |
278 | 284 | return true; /* ? */ |
— | — | @@ -339,12 +345,18 @@ |
340 | 346 | |
341 | 347 | function expireall() { |
342 | 348 | /* Remove any items that have expired */ |
| 349 | + if ( wfReadOnly() ) { |
| 350 | + return false; |
| 351 | + } |
343 | 352 | $now = $this->_fromunixtime( time() ); |
344 | 353 | $this->_query( "DELETE FROM $0 WHERE exptime < '$now'" ); |
345 | 354 | } |
346 | 355 | |
347 | 356 | function deleteall() { |
348 | 357 | /* Clear *all* items from cache table */ |
| 358 | + if ( wfReadOnly() ) { |
| 359 | + return false; |
| 360 | + } |
349 | 361 | $this->_query( "DELETE FROM $0" ); |
350 | 362 | } |
351 | 363 | |