]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 313531: Move 'use Bugzilla;' out of globals.pl - Patch by Frédéric Buclin <LpSoli...
authorlpsolit%gmail.com <>
Tue, 20 Jun 2006 14:55:39 +0000 (14:55 +0000)
committerlpsolit%gmail.com <>
Tue, 20 Jun 2006 14:55:39 +0000 (14:55 +0000)
14 files changed:
Bugzilla/Chart.pm
buglist.cgi
customfield.pl
editparams.cgi
editversions.cgi
editwhines.cgi
globals.pl
index.cgi
query.cgi
quips.cgi
sanitycheck.cgi
sidebar.cgi
testserver.pl
whine.pl

index a0853d508bbf7c6345d315c61f9c2ba6c2d9b8a1..c878186bc798452e4ac7fd455c1b3802d34b9ea1 100644 (file)
@@ -36,6 +36,7 @@ use Bugzilla::Util;
 use Bugzilla::Series;
 
 use Date::Format;
+use Date::Parse;
 
 sub new {
     my $invocant = shift;
@@ -99,7 +100,7 @@ sub init {
     # Make sure the dates are ones we are able to interpret
     foreach my $date ('datefrom', 'dateto') {
         if ($self->{$date}) {
-            $self->{$date} = &::str2time($self->{$date}) 
+            $self->{$date} = str2time($self->{$date}) 
               || &::ThrowUserError("illegal_date", { date => $self->{$date}});
         }
     }
@@ -223,7 +224,7 @@ sub readData {
     my $datefrom = $dbh->selectrow_array("SELECT MIN(series_date) " . 
                                          "FROM series_data " .
                                          "WHERE series_id IN ($series_ids)");
-    $datefrom = &::str2time($datefrom);
+    $datefrom = str2time($datefrom);
 
     if ($self->{'datefrom'} && $self->{'datefrom'} > $datefrom) {
         $datefrom = $self->{'datefrom'};
@@ -232,7 +233,7 @@ sub readData {
     my $dateto = $dbh->selectrow_array("SELECT MAX(series_date) " . 
                                        "FROM series_data " .
                                        "WHERE series_id IN ($series_ids)");
-    $dateto = &::str2time($dateto); 
+    $dateto = str2time($dateto); 
 
     if ($self->{'dateto'} && $self->{'dateto'} < $dateto) {
         $dateto = $self->{'dateto'};
@@ -420,7 +421,7 @@ sub generateDateProgression {
     $dateto += (2 * $oneday) / 3;
 
     while ($datefrom < $dateto) {
-        push (@progression, &::time2str("%Y-%m-%d", $datefrom));
+        push (@progression, time2str("%Y-%m-%d", $datefrom));
         $datefrom += $oneday;
     }
 
index 8465cae32e0c5340549e0360a1f62c3d541dc912..5d56c2255703bc450f289b434a5012d31ef6d525 100755 (executable)
@@ -44,6 +44,8 @@ use Bugzilla::Product;
 use Bugzilla::Keyword;
 use Bugzilla::Field;
 
+use Date::Parse;
+
 # Include the Bugzilla CGI and general utility library.
 require "globals.pl";
 
index 106c60582bd127bd8be2354253c9dd3a713d463a..101bac880a1e3d29881cc53a61d18e91f5af7354 100755 (executable)
@@ -29,6 +29,7 @@ use strict;
 use lib ".";
 require "globals.pl";
 
+use Bugzilla;
 use Bugzilla::Field;
 use Getopt::Long;
 
index 487208b4798c354fd2c9e1ffce683e3f25a10168..bb8fa591b884c8600ef1c2cda434739f50e98abd 100755 (executable)
@@ -25,6 +25,7 @@
 use strict;
 use lib ".";
 
+use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Config qw(:DEFAULT :admin :params $datadir);
 use Bugzilla::Config::Common;
index c060657d2aac6a277770d7267361dc1c25293c8f..dec675b5b403758c06a675b790cee81a5f5770d2 100755 (executable)
@@ -33,6 +33,7 @@ use lib ".";
 
 require "globals.pl";
 
+use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Config qw(:DEFAULT $datadir);
 use Bugzilla::Product;
index 8086862d2415562a32e60373275b9e1bd48f8dab..0db643552258d430871c56878f7fe86bd3c9e131 100755 (executable)
@@ -30,6 +30,7 @@ use strict;
 use lib ".";
 require "globals.pl";
 
+use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::User;
 use Bugzilla::Group;
index 2654c4a1f4409994f6a6823b5d137f4c5e56120c..146b51550f90174b3607c09c115751944e934577 100644 (file)
@@ -42,16 +42,4 @@ use Bugzilla::Error;
 # of globals.pl
 do $localconfig;
 
-use DBI;
-
-use Date::Format;               # For time2str().
-use Date::Parse;               # For str2time().
-
-# Use standard Perl libraries for cross-platform file/directory manipulation.
-use File::Spec;
-
-############# Live code below here (that is, not subroutine defs) #############
-
-use Bugzilla;
-
 1;
index 27f26083d2e1663722b4fc4f6981ffe5b1dd232b..a409fe95197f6c90b6026f4db7c7fc44b5641b55 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -32,6 +32,7 @@ use strict;
 use lib ".";
 require "globals.pl";
 
+use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Update;
 
index 1ab53a9b8adfd43577c8576dcef187ee4fc4c394..67fc963624478e6d30ae4b01a6ed69e227e67e5f 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
@@ -30,6 +30,7 @@ use lib ".";
 
 require "globals.pl";
 
+use Bugzilla;
 use Bugzilla::Bug;
 use Bugzilla::Constants;
 use Bugzilla::Search;
index b2fd482bcc72bd0f533dcc8faa5e60f769fa65c2..fa421c5343a61fe169f3c24870d2d43c37261cf6 100755 (executable)
--- a/quips.cgi
+++ b/quips.cgi
@@ -29,6 +29,7 @@ use lib qw(.);
 
 require "globals.pl";
 
+use Bugzilla;
 use Bugzilla::Constants;
 
 my $user = Bugzilla->login(LOGIN_REQUIRED);
index b887deeff6dcb4c203d489bf859102ffdb3d4223..7a74bfc070e21329aa649af63f3c36463a768d7c 100755 (executable)
@@ -28,6 +28,8 @@ use strict;
 use lib qw(.);
 
 require "globals.pl";
+
+use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Util;
 use Bugzilla::User;
index 2f7743ebb59a6f1bcf74bfaa9fbcb1c7553ea003..671e44c7d9726169396beb67e2699e8f01785608 100755 (executable)
@@ -20,8 +20,9 @@ use strict;
 use lib ".";
 require "globals.pl";
 
-Bugzilla->login();
+use Bugzilla;
 
+Bugzilla->login();
 my $cgi = Bugzilla->cgi;
 my $template = Bugzilla->template;
 
index 0d1d08ba5878d9a9c8b139bea77a88159b6977d6..2211f8bfecba4dc3a95040eca95fd4de09094da8 100755 (executable)
 # as its only argument.  It attempts to troubleshoot as many installation
 # issues as possible.
 
+use strict;
+
+BEGIN {
+    my $envpath = $ENV{'PATH'};
+    require Bugzilla;
+    $ENV{'PATH'} = $envpath;
+}
+
+use lib ".";
+
 use Socket;
 use Bugzilla::Config qw($datadir);
-my $envpath = $ENV{'PATH'};
-use lib ".";
-use strict;
+
 require "globals.pl";
 eval "require LWP; require LWP::UserAgent;";
 my $lwp = $@ ? 0 : 1;
 
-$ENV{'PATH'}= $envpath;
-
 if ((@ARGV != 1) || ($ARGV[0] !~ /^https?:/))
 {
     print "Usage: $0 <URL to this Bugzilla installation>\n";
index 9f5a9acfee656acb8f567199b5d8531656c85b9c..551defe49034eda8175dbf6d9039c36945c207d0 100755 (executable)
--- a/whine.pl
+++ b/whine.pl
@@ -29,6 +29,7 @@ use strict;
 use lib ".";
 require "globals.pl";
 
+use Bugzilla;
 use Bugzilla::Config qw(:DEFAULT $datadir);
 use Bugzilla::Constants;
 use Bugzilla::Search;