diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2011-10-23 13:11:46 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-10-23 13:11:46 +0200 |
commit | ce3970fd0a2890b88485c2723e7af1633544c741 (patch) | |
tree | 366eafb66421457ad9e0b62172e8d8c1c37477cc /Bugzilla/Install/Util.pm | |
parent | e9f859e128e5c9c6e74a95c79ab60ed123a94c14 (diff) | |
download | bugzilla-ce3970fd0a2890b88485c2723e7af1633544c741.tar.gz bugzilla-ce3970fd0a2890b88485c2723e7af1633544c741.tar.xz |
Bug 696541: Only load some external modules when needed, to improve the load time of pages
r/a=mkanat
Diffstat (limited to 'Bugzilla/Install/Util.pm')
-rw-r--r-- | Bugzilla/Install/Util.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Bugzilla/Install/Util.pm b/Bugzilla/Install/Util.pm index bd8942507..43433eb96 100644 --- a/Bugzilla/Install/Util.pm +++ b/Bugzilla/Install/Util.pm @@ -29,11 +29,9 @@ use strict; use Bugzilla::Constants; use Encode; -use ExtUtils::MM (); use File::Basename; use File::Spec; use POSIX qw(setlocale LC_CTYPE); -use Safe; use Scalar::Util qw(tainted); use Term::ANSIColor qw(colored); use PerlIO; @@ -58,6 +56,9 @@ our @EXPORT_OK = qw( sub bin_loc { my ($bin, $path) = @_; + # This module is not needed most of the time and is a bit slow, + # so we only load it when calling bin_loc(). + require ExtUtils::MM; # If the binary is a full path... if ($bin =~ m{[/\\]}) { @@ -541,7 +542,10 @@ sub no_checksetup_from_cgi { # Used by install_string sub _get_string_from_file { my ($string_id, $file) = @_; - + # This module is only needed by checksetup.pl, + # so only load it when needed. + require Safe; + return undef if !-e $file; my $safe = new Safe; $safe->rdo($file); |