From: Dylan William Hardison Date: Sun, 26 Feb 2017 23:05:50 +0000 (+0000) Subject: Bug 1342813 - $SIG{__DIE__} is set to Bugzilla::_console_die() when running under... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2680841f7ff1edd5077c181171f8018d3584d302;p=thirdparty%2Fbugzilla.git Bug 1342813 - $SIG{__DIE__} is set to Bugzilla::_console_die() when running under Plack --- diff --git a/Bugzilla.pm b/Bugzilla.pm index 5a57dbab2a..880426e5b0 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -133,7 +133,7 @@ sub init_page { my $script = basename($0); # If Bugzilla is shut down, do not allow anything to run, just display a - # message to the user about the downtime and log out. Scripts listed in + # message to the user about the downtime and log out. Scripts listed in # SHUTDOWNHTML_EXEMPT are exempt from this message. # # This code must go here. It cannot go anywhere in Bugzilla::CGI, because @@ -221,7 +221,7 @@ sub extensions { my $extension = $package->new(); if ($extension->enabled) { push(@extensions, $extension); - } + } } $cache->{extensions} = \@extensions; } @@ -346,7 +346,7 @@ sub login { } my $authenticated_user = $authorizer->login($type); - + # At this point, we now know if a real person is logged in. # We must now check to see if an sudo session is in progress. # For a session to be in progress, the following must be true: @@ -521,7 +521,12 @@ sub usage_mode { return $class->request_cache->{usage_mode}; } else { - return (i_am_cgi()? USAGE_MODE_BROWSER : USAGE_MODE_CMDLINE); + if ($ENV{BZ_PLACK} || $ENV{MOD_PERL}) { + return USAGE_MODE_BROWSER; + } + else { + return (i_am_cgi()? USAGE_MODE_BROWSER : USAGE_MODE_CMDLINE); + } } } @@ -702,7 +707,7 @@ sub END { } # Also managed in mod_perl.pl and app.psgi. -init_page() unless i_am_persistent(); +init_page() unless(); 1; @@ -830,8 +835,8 @@ progress, returns the C object corresponding to the currently logged in user. =item C -This begins an sudo session for the current request. It is meant to be -used when a session has just started. For normal use, sudo access should +This begins an sudo session for the current request. It is meant to be +used when a session has just started. For normal use, sudo access should normally be set at login time. =item C @@ -928,7 +933,7 @@ Cusage_mode> will return the current state of this flag. =item C -Determines whether or not installation should be silent. See +Determines whether or not installation should be silent. See L for the C constants. =item C diff --git a/app.psgi b/app.psgi index 50e341f6ba..5a83a41e4d 100644 --- a/app.psgi +++ b/app.psgi @@ -27,6 +27,8 @@ BEGIN { *lib::import = sub { }; } +BEGIN { $ENV{BZ_PLACK} = 'Plack' } + use Bugzilla::Constants (); use Plack; @@ -46,8 +48,6 @@ use constant STATIC => qw( skins ); -$ENV{BZ_PLACK} = 'Plack/' . Plack->VERSION; - my $app = builder { my $static_paths = join( '|', sort { length $b <=> length $a || $a cmp $b } STATIC );