Index: branches/RL2/extensions/Gadgets/backend/ForeignDBGadgetRepo.php |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | } |
92 | 92 | |
93 | 93 | protected function getLoadAllDataQuery() { |
94 | | - $query = parent::getLoadIDsQuery(); |
| 94 | + $query = parent::getLoadAllDataQuery(); |
95 | 95 | $query['conds']['gd_shared'] = 1; |
96 | 96 | return $query; |
97 | 97 | } |
Index: branches/RL2/extensions/Gadgets/backend/CachedGadgetRepo.php |
— | — | @@ -121,12 +121,18 @@ |
122 | 122 | } |
123 | 123 | |
124 | 124 | $this->data = $this->loadAllData(); |
| 125 | + $arrayKeys = array_keys( $this->data ); |
125 | 126 | // For memc, prepare an array with the IDs as keys but with each value set to null |
126 | | - $toCache = array_combine( array_keys( $data ), array_fill( 0, count( $this->data ), null ) ); |
| 127 | + $toCache = array_combine( $arrayKeys, array_fill( 0, count( $arrayKeys ), null ) ); |
| 128 | + $wgMemc->set( $key, $toCache ); |
127 | 129 | |
128 | | - $wgMemc->set( $key, $toCache ); |
| 130 | + // Now that we have the data for every gadget, let's refresh those cache entries too |
| 131 | + foreach ( $this->data as $id => $gadgetData ) { |
| 132 | + $wgMemc->set( $this->getCacheKey( $id ), $gadgetData ); |
| 133 | + } |
| 134 | + |
129 | 135 | $this->idsLoaded = true; |
130 | | - return array_keys( $this->data ); |
| 136 | + return $arrayKeys; |
131 | 137 | } |
132 | 138 | |
133 | 139 | /** |