Permalink
Browse files

Should fix #9255, this prevents an issue where we try to issue a back…

…end command before we are connected to a backend.

(cherry picked from commit 7cb9061)
  • Loading branch information...
1 parent cc03d21 commit 1a998aa08c3a3f9b18ea2b9f4da9c73f0c37908d @kormoc kormoc committed Dec 21, 2010
Showing with 6 additions and 5 deletions.
  1. +3 −3 includes/db_update.php
  2. +3 −2 includes/utils.php
@@ -39,11 +39,11 @@
data BLOB NOT NULL,
INDEX (modified)
)');
- setting('WebDBSchemaVer', null, ++$db_vers);
+ setting('WebDBSchemaVer', null, ++$db_vers, false);
// Moving settings into the database
case 1:
- setting('WebPrefer_Channum', null, 1);
- setting('WebDBSchemaVer', null, ++$db_vers);
+ setting('WebPrefer_Channum', null, 1, false);
+ setting('WebDBSchemaVer', null, ++$db_vers, false);
// All other numbers should run their changes sequentially
#case 2:
# # do something to upgrade the database here
View
@@ -30,7 +30,7 @@
*
* @return string The value (settings.data) associated with $field and $hostname.
/**/
- function setting($field, $hostname=null, $new_value = "old\0old") {
+ function setting($field, $hostname=null, $new_value = "old\0old", $clearSettingsCache = true) {
global $db;
static $cache = array();
// Best not to have an array index that's null
@@ -54,7 +54,8 @@ function setting($field, $hostname=null, $new_value = "old\0old") {
// occasional times where setting() gets called before we're actually
// connected to the backend, the only known instance is in db_update.php
// and those settings don't affect anything but MythWeb.
- MythBackend::find()->sendCommand('CLEAR_SETTINGS_CACHE');
+ if ($clearSettingsCache)
+ MythBackend::find()->sendCommand('CLEAR_SETTINGS_CACHE');
}
// Not cached?
elseif (!array_key_exists($field, $cache[$h])) {

0 comments on commit 1a998aa

Please sign in to comment.