]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 696537: Load DateTime only when datetime_from() is called
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 18 Nov 2011 12:14:32 +0000 (13:14 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 18 Nov 2011 12:14:32 +0000 (13:14 +0100)
r/a=mkanat

Bugzilla/Util.pm
mod_perl.pl

index d158be1e1bd7609ff6e3f33e0cd49fe0412bdc0c..1f698f80e5c999f00fb0fead96b3b9a6aac636ce 100644 (file)
@@ -50,8 +50,6 @@ use Bugzilla::RNG qw(irand);
 
 use Date::Parse;
 use Date::Format;
-use DateTime;
-use DateTime::TimeZone;
 use Digest;
 use Email::Address;
 use List::Util qw(first);
@@ -485,6 +483,9 @@ sub datetime_from {
         delete $args{$arg} if !defined $args{$arg};
     }
 
+    # This module takes time to load and is only used here, so we
+    # |require| it here rather than |use| it.
+    require DateTime;
     my $dt = new DateTime(\%args);
 
     # Now display the date using the given timezone,
index 2f4016952b57a78e6bc42da4587a92fbb93c2055..fb597d7447099b64daa4c3ee4e933b1e5c362317 100644 (file)
@@ -39,6 +39,7 @@ use Apache2::Log ();
 use Apache2::ServerUtil;
 use ModPerl::RegistryLoader ();
 use File::Basename ();
+use DateTime ();
 
 # This loads most of our modules.
 use Bugzilla ();