Changeset 159 for trunk/lib/Prefs.inc.php
- Timestamp:
- Jun 11, 2006 5:41:23 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Prefs.inc.php
r158 r159 180 180 } 181 181 182 // Set a persistent perference if... 183 // - there isn't a default. 184 // - the new value is different than the default 185 // - there is a previously existing pesistent key. 182 186 if (!isset($_SESSION['_prefs'][$this->_ns]['defaults'][$key]) || $_SESSION['_prefs'][$this->_ns]['defaults'][$key] != $val || isset($_SESSION['_prefs'][$this->_ns]['persistent'][$key])) { 183 187 $_SESSION['_prefs'][$this->_ns]['persistent'][$key] = $val; 188 $app->logMsg(sprintf('Setting preference %s to %s', $key, $val), LOG_DEBUG, __FILE__, __LINE__); 189 } else { 190 $app->logMsg(sprintf('not setting %s to %s', $key, $val), LOG_DEBUG, __FILE__, __LINE__); 184 191 } 185 192 } … … 347 354 $this->initDB(); 348 355 349 if (isset($_SESSION['_prefs'][$this->_ns]['persistent']) && is_array($_SESSION['_prefs'][$this->_ns]['persistent']) ) {356 if (isset($_SESSION['_prefs'][$this->_ns]['persistent']) && is_array($_SESSION['_prefs'][$this->_ns]['persistent']) && !empty($_SESSION['_prefs'][$this->_ns]['persistent'])) { 350 357 // Delete old prefs from database. 351 358 $db->query(" … … 365 372 ); 366 373 } 374 // TODO: after MySQL 5.0.23 is released this query could benefit from INSERT DELAYED. 367 375 $db->query(" 368 INSERT LOW_PRIORITYINTO " . $db->escapeString($this->getParam('db_table')) . "376 INSERT INTO " . $db->escapeString($this->getParam('db_table')) . " 369 377 (user_id, pref_namespace, pref_key, pref_value) 370 378 VALUES " . join(', ', $insert_values) . "
Note: See TracChangeset
for help on using the changeset viewer.