diff options
author | Byron Jones <glob@mozilla.com> | 2015-03-05 05:57:51 +0100 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-03-05 05:57:51 +0100 |
commit | b7147b778824e13a15f912fdf458bf3959d439e5 (patch) | |
tree | 1deddd019fb15747dacc3067d0c2606f864fc41c /Bugzilla.pm | |
parent | f6686ca1edfe4a233c7f39836e265d466bda37b7 (diff) | |
download | bugzilla-b7147b778824e13a15f912fdf458bf3959d439e5.tar.gz bugzilla-b7147b778824e13a15f912fdf458bf3959d439e5.tar.xz |
Bug 1128853: Bugzilla shouldn't try to write API tokens into the shadow DB
r=dkl,a=glob
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r-- | Bugzilla.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index 46d6182cd..6ca46f430 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -537,6 +537,11 @@ sub switch_to_main_db { return $class->dbh_main; } +sub is_shadow_db { + my $class = shift; + return $class->request_cache->{dbh} != $class->dbh_main; +} + sub fields { my ($class, $criteria) = @_; $criteria ||= {}; @@ -942,6 +947,12 @@ Switch from using the main database to using the shadow database. Change the database object to refer to the main database. +=item C<is_shadow_db> + +Returns true if the currently active database is the shadow database. +Returns false if a the currently active database is the man database, or if a +shadow database is not configured or enabled. + =item C<params> The current Parameters of Bugzilla, as a hashref. If C<data/params.json> |