summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2004-11-08 11:25:58 +0100
committerbugreport%peshkin.net <>2004-11-08 11:25:58 +0100
commit7ab8441582a6b9ce1b2335762948662b38aaf217 (patch)
tree2b6e3430cf432480102664b43dbc6b3416817e59 /Bugzilla.pm
parent1f389b9186fb57c781c59fdf38caa45e69912324 (diff)
downloadbugzilla-7ab8441582a6b9ce1b2335762948662b38aaf217.tar.gz
bugzilla-7ab8441582a6b9ce1b2335762948662b38aaf217.tar.xz
Bug 257344: Remove exit from error handlers when non-interactive
r=glob,justdave a=justdave
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 1c2a6a4b0..e87639608 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -111,6 +111,16 @@ sub dbh {
return $_dbh;
}
+my $_batch;
+sub batch {
+ my $class = shift;
+ my $newval = shift;
+ if ($newval) {
+ $_batch = $newval;
+ }
+ return $_batch || 0;
+}
+
sub dbwritesallowed {
my $class = shift;
@@ -282,6 +292,13 @@ Essentially, causes calls to C<Bugzilla->user> to return C<undef>. This has the
effect of logging out a user for the current request only; cookies and
database sessions are left intact.
+=item C<batch>
+
+Set to true, by calling Bugzilla->batch(1), to indicate that Bugzilla is
+being called in a non-interactive manner and errors should be passed to
+die() rather than being sent to a browser and finished with an exit().
+Bugzilla->batch will return the current state of this flag.
+
=item C<dbh>
The current database handle. See L<DBI>.