aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-11-18 13:14:32 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-11-18 13:14:32 +0100
commit34b392c34fab6beb3d94ed944fb90f94fcf38d76 (patch)
tree61708ebed11cc99b243eb3723e138bd4a377a000
parentbf1b11403e315a95d27dd12da297ceebbf9f3a4e (diff)
downloadbugs-34b392c34fab6beb3d94ed944fb90f94fcf38d76.tar
bugs-34b392c34fab6beb3d94ed944fb90f94fcf38d76.tar.gz
bugs-34b392c34fab6beb3d94ed944fb90f94fcf38d76.tar.bz2
bugs-34b392c34fab6beb3d94ed944fb90f94fcf38d76.tar.xz
bugs-34b392c34fab6beb3d94ed944fb90f94fcf38d76.zip
Bug 696537: Load DateTime only when datetime_from() is called
r/a=mkanat
-rw-r--r--Bugzilla/Util.pm5
-rw-r--r--mod_perl.pl1
2 files changed, 4 insertions, 2 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index d158be1e1..1f698f80e 100644
--- a/Bugzilla/Util.pm
+++ b/Bugzilla/Util.pm
@@ -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,
diff --git a/mod_perl.pl b/mod_perl.pl
index 2f4016952..fb597d744 100644
--- a/mod_perl.pl
+++ b/mod_perl.pl
@@ -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 ();