Skip to content

Commit

Permalink
Avoid calls to backend_command() if the function has not yet been def…
Browse files Browse the repository at this point in the history
…ined. Also make sure that certain variables are defined as 'global' in case I later decide to actually load the backend connection routines early. Closes #3305 again.

git-svn-id: http://svn.mythtv.org/svn/trunk@13335 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
ex-nerd committed Apr 25, 2007
1 parent 06f07bf commit 7b13a2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions includes/mythbackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
// NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
// the number of items in a ProgramInfo QStringList group used by
// ProgramInfo::ToSringList and ProgramInfo::FromStringList.
global $NUMPROGRAMLINES;
$NUMPROGRAMLINES = 43;

// Keep track of the master backend port/ip
global $Master_Host, $Master_Port;
$Master_Host = get_backend_setting('MasterServerIP');
$Master_Port = get_backend_setting('MasterServerPort');
if (!$Master_Host || !$Master_Port)
Expand Down
9 changes: 7 additions & 2 deletions includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ function setting($field, $hostname=null, $new_value = "old\0old") {
$db->query('INSERT INTO settings (value, data, hostname) VALUES (?,?,?)',
$field, $new_value, $hostname);
$cache[$h][$field] = $new_value;
// Alert the rest of the MythTV network
backend_command('CLEAR_SETTINGS_CACHE');
// Alert the rest of the MythTV network. Though there are some
// 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.
if (function_exists('backend_command')) {
backend_command('CLEAR_SETTINGS_CACHE');
}
}
// Not cached?
elseif (!array_key_exists($field, $cache[$h])) {
Expand Down

0 comments on commit 7b13a2a

Please sign in to comment.