From a2dd3b00284fd4724d3408274cb1156c7a77d187 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 24 Oct 2009 05:21:06 +0000 Subject: Bug 520948: Use Bugzilla->feature and feature_enabled everywhere instead of checking if modules are installed Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- Bugzilla/Update.pm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'Bugzilla/Update.pm') diff --git a/Bugzilla/Update.pm b/Bugzilla/Update.pm index d3f780570..292ab626e 100644 --- a/Bugzilla/Update.pm +++ b/Bugzilla/Update.pm @@ -27,13 +27,9 @@ use constant TIMEOUT => 5; # Number of seconds before timeout. # Look for new releases and notify logged in administrators about them. sub get_notifications { + return if !Bugzilla->feature('updates'); return if (Bugzilla->params->{'upgrade_notification'} eq 'disabled'); - # If the XML::Twig module is missing, we won't be able to parse - # the XML file. So there is no need to go further. - eval("require XML::Twig"); - return if $@; - my $local_file = bz_locations()->{'datadir'} . LOCAL_FILE; # Update the local XML file if this one doesn't exist or if # the last modification time (stat[9]) is older than TIME_INTERVAL. @@ -128,9 +124,6 @@ sub get_notifications { } sub _synchronize_data { - eval("require LWP::UserAgent"); - return {'error' => 'missing_package', 'package' => 'LWP::UserAgent'} if $@; - my $local_file = bz_locations()->{'datadir'} . LOCAL_FILE; my $ua = LWP::UserAgent->new(); -- cgit v1.2.3-24-g4f1b