Index: branches/RL2/extensions/Gadgets/backend/CachedGadgetRepo.php |
— | — | @@ -123,7 +123,12 @@ |
124 | 124 | $this->data = $this->loadAllData(); |
125 | 125 | $arrayKeys = array_keys( $this->data ); |
126 | 126 | // For memc, prepare an array with the IDs as keys but with each value set to null |
127 | | - $toCache = array_combine( $arrayKeys, array_fill( 0, count( $arrayKeys ), null ) ); |
| 127 | + if ( count( $arrayKeys ) > 0 ) { |
| 128 | + $toCache = array_combine( $arrayKeys, array_fill( 0, count( $arrayKeys ), null ) ); |
| 129 | + } else { |
| 130 | + // array_fill() and array_combine() don't like empty arrays |
| 131 | + $toCache = array(); |
| 132 | + } |
128 | 133 | $wgMemc->set( $key, $toCache ); |
129 | 134 | |
130 | 135 | // Now that we have the data for every gadget, let's refresh those cache entries too |