summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm28
1 files changed, 13 insertions, 15 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 29675865b..73d080395 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -13,15 +13,6 @@ use warnings;
use Bugzilla::Logging;
-# We want any compile errors to get to the browser, if possible.
-BEGIN {
- # This makes sure we're in a CGI.
- if ($ENV{SERVER_SOFTWARE} && !$ENV{MOD_PERL}) {
- require CGI::Carp;
- CGI::Carp->import('fatalsToBrowser');
- }
-}
-
our $VERSION = '20180717.2';
use Bugzilla::Auth;
@@ -202,8 +193,17 @@ sub init_page {
# Subroutines and Methods
#####################################################################
+my $preload_templates = 0;
+sub preload_templates {
+ $preload_templates = 1;
+
+ delete request_cache->{template};
+ template();
+ return 1;
+}
+
sub template {
- request_cache->{template} ||= Bugzilla::Template->create();
+ request_cache->{template} //= Bugzilla::Template->create(preload => $preload_templates);
request_cache->{template}->{_is_main} = 1;
return request_cache->{template};
@@ -214,7 +214,8 @@ sub template_inner {
my $cache = request_cache;
my $current_lang = $cache->{template_current_lang}->[0];
$lang ||= $current_lang || '';
- return $cache->{"template_inner_$lang"} ||= Bugzilla::Template->create(language => $lang);
+ my %options = (language => $lang, preload => $preload_templates);
+ return $cache->{"template_inner_$lang"} ||= Bugzilla::Template->create(%options);
}
sub extensions {
@@ -234,7 +235,7 @@ sub extensions {
}
sub cgi {
- return request_cache->{cgi} ||= new Bugzilla::CGI();
+ return request_cache->{cgi} ||= Bugzilla::CGI->new;
}
sub input_params {
@@ -340,9 +341,6 @@ sub login {
return $class->user if $class->user->id;
- # Load all extensions here if not running under mod_perl
- $class->extensions unless $ENV{MOD_PERL};
-
my $authorizer = new Bugzilla::Auth();
$type = LOGIN_REQUIRED if $class->cgi->param('GoAheadAndLogIn');