summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Quantum/Plugin/Hostage.pm2
-rw-r--r--Bugzilla/User/Setting.pm8
-rw-r--r--Bugzilla/UserAgent.pm1
-rw-r--r--Bugzilla/WebService/Server/REST.pm8
4 files changed, 11 insertions, 8 deletions
diff --git a/Bugzilla/Quantum/Plugin/Hostage.pm b/Bugzilla/Quantum/Plugin/Hostage.pm
index 42a05a910..418b09a0c 100644
--- a/Bugzilla/Quantum/Plugin/Hostage.pm
+++ b/Bugzilla/Quantum/Plugin/Hostage.pm
@@ -77,4 +77,4 @@ sub _before_routes {
}
}
-1; \ No newline at end of file
+1;
diff --git a/Bugzilla/User/Setting.pm b/Bugzilla/User/Setting.pm
index a0b079ec7..ac53fbb32 100644
--- a/Bugzilla/User/Setting.pm
+++ b/Bugzilla/User/Setting.pm
@@ -13,8 +13,6 @@ use strict;
use warnings;
use base qw(Exporter);
-
-
# Module stuff
@Bugzilla::User::Setting::EXPORT = qw(
get_all_settings
@@ -25,6 +23,7 @@ use base qw(Exporter);
use Bugzilla::Error;
use Bugzilla::Util qw(trick_taint get_text);
+use Module::Runtime qw(require_module);
###############################
### Module Initialization ###
@@ -104,9 +103,8 @@ sub new {
$self->{'category'} = shift;
}
if ($subclass) {
- eval('require ' . $class . '::' . $subclass);
- $@ && ThrowCodeError('setting_subclass_invalid',
- {'subclass' => $subclass});
+ eval { require_module( $class . '::' . $subclass ) }
+ || ThrowCodeError( 'setting_subclass_invalid', { 'subclass' => $subclass } );
$class = $class . '::' . $subclass;
}
bless($self, $class);
diff --git a/Bugzilla/UserAgent.pm b/Bugzilla/UserAgent.pm
index 0db6de808..bd31a2a13 100644
--- a/Bugzilla/UserAgent.pm
+++ b/Bugzilla/UserAgent.pm
@@ -26,6 +26,7 @@ use constant PLATFORMS_MAP => (
qr/\(.*[ix0-9]86 (?:on |\()x86_64.*\)/ => ["IA32", "x86", "PC"],
qr/\(.*amd64.*\)/ => ["AMD64", "x86_64", "PC"],
qr/\(.*x86_64.*\)/ => ["AMD64", "x86_64", "PC"],
+ qr/\(.*Intel Mac OS X.*\)/ => ["x86_64"],
# Intel IA64
qr/\(.*IA64.*\)/ => ["IA64", "PC"],
# Intel x86
diff --git a/Bugzilla/WebService/Server/REST.pm b/Bugzilla/WebService/Server/REST.pm
index b8884b753..13896b248 100644
--- a/Bugzilla/WebService/Server/REST.pm
+++ b/Bugzilla/WebService/Server/REST.pm
@@ -34,6 +34,7 @@ use Bugzilla::WebService::Server::REST::Resources::Elastic;
use List::MoreUtils qw(uniq);
use Scalar::Util qw(blessed reftype);
use MIME::Base64 qw(decode_base64);
+use Module::Runtime qw(require_module);
###########################
# Public Method Overrides #
@@ -392,6 +393,10 @@ sub _retrieve_json_params {
return $params;
}
+sub preload {
+ require_module($_) for values %{ WS_DISPATCH() };
+}
+
sub _find_resource {
my ($self, $path) = @_;
@@ -399,13 +404,12 @@ sub _find_resource {
# $module->rest_resources to get the resources array ref.
my $resources = {};
foreach my $module (values %{ $self->{dispatch_path} }) {
- eval("require $module") || die $@;
next if !$module->can('rest_resources');
$resources->{$module} = $module->rest_resources;
}
Bugzilla::Hook::process('webservice_rest_resources',
- { rpc => $self, resources => $resources });
+ { rpc => $self, resources => $resources }) if Bugzilla::request_cache->{bzapi};
# Use the resources hash from each module loaded earlier to determine
# which handler to use based on a regex match of the CGI path.