Index: trunk/extensions/Configure/Configure.handler-db.php |
— | — | @@ -89,6 +89,7 @@ |
90 | 90 | /** |
91 | 91 | * Load the current configuration the database (i.e. cv_is_latest == 1) |
92 | 92 | * directory |
| 93 | + * FIXME: serious O(n) overhead |
93 | 94 | */ |
94 | 95 | public function getCurrent( $useCache = true ) { |
95 | 96 | static $ipCached = null; |
— | — | @@ -97,7 +98,7 @@ |
98 | 99 | return $ipCached; |
99 | 100 | |
100 | 101 | # Check filesystem cache |
101 | | - if ( ( $cached = $this->getFSCached() ) && $useCache ) { |
| 102 | + if ( $useCache && ( $cached = $this->getFSCached() ) ) { |
102 | 103 | $this->cacheToFS( $cached ); |
103 | 104 | return $ipCached = $cached; |
104 | 105 | } |
— | — | @@ -134,6 +135,7 @@ |
135 | 136 | /** |
136 | 137 | * Return the old configuration from $ts |
137 | 138 | * Does *not* return site specific settings but *all* settings |
| 139 | + * FIXME: serious O(n) overhead |
138 | 140 | * |
139 | 141 | * @param $ts timestamp |
140 | 142 | * @return array |
— | — | @@ -157,6 +159,7 @@ |
158 | 160 | |
159 | 161 | /** |
160 | 162 | * Returns the wikis in $ts version |
| 163 | + * FIXME: only returns the first match |
161 | 164 | * |
162 | 165 | * @param $ts timestamp |
163 | 166 | * @return array |
— | — | @@ -222,7 +225,7 @@ |
223 | 226 | $newId = $dbw->insertId(); |
224 | 227 | $dbw->update( 'config_version', |
225 | 228 | array( 'cv_is_latest' => 0 ), |
226 | | - array( 'cv_wiki' => $wiki, 'cv_timestamp <> ' . $dbw->addQuotes( $dbw->timestamp($ts) ) ), |
| 229 | + array( 'cv_wiki' => $wiki, "cv_id != {$newId}" ), |
227 | 230 | __METHOD__ ); |
228 | 231 | $insert = array(); |
229 | 232 | foreach ( $settings as $name => $val ) { |
— | — | @@ -239,6 +242,8 @@ |
240 | 243 | |
241 | 244 | /** |
242 | 245 | * List all archived versions |
| 246 | + * FIXME: serious O(n) overhead |
| 247 | + * FIXME: timestamp not unique |
243 | 248 | * @return array of timestamps |
244 | 249 | */ |
245 | 250 | public function getArchiveVersions() { |