]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1342813 - $SIG{__DIE__} is set to Bugzilla::_console_die() when running under...
authorDylan William Hardison <dylan@hardison.net>
Sun, 26 Feb 2017 23:05:50 +0000 (23:05 +0000)
committerDylan William Hardison <dylan@hardison.net>
Sun, 6 Aug 2017 16:20:11 +0000 (12:20 -0400)
Bugzilla.pm
app.psgi

index 5a57dbab2a035f3734fb94b27d0f8147d247dfde..880426e5b0ef2aa381ca8031dbe9f570b839c774 100644 (file)
@@ -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<Bugzilla::User> object corresponding to the currently
 logged in user.
 
 =item C<sudo_request>
-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<login>
@@ -928,7 +933,7 @@ C<Bugzilla-E<gt>usage_mode> will return the current state of this flag.
 
 =item C<installation_mode>
 
-Determines whether or not installation should be silent. See 
+Determines whether or not installation should be silent. See
 L<Bugzilla::Constants> for the C<INSTALLATION_MODE> constants.
 
 =item C<installation_answers>
index 50e341f6ba9fac1a015b37bbafe27f6908ec3553..5a83a41e4d42d8edfd11486a8a0736908b68d410 100644 (file)
--- 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 );