diff options
author | lpsolit%gmail.com <> | 2006-06-20 14:55:39 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-06-20 14:55:39 +0000 |
commit | 7f446ae898dc9f9fe8d97fdd01f0e39ba7676867 (patch) | |
tree | f6c6d8a3daa4b8244498c9b924a70bdaa5e324fd | |
parent | 5ffe3d31dde3c11525ff09ce17e4b0d730e5e2fd (diff) | |
download | bugs-7f446ae898dc9f9fe8d97fdd01f0e39ba7676867.tar bugs-7f446ae898dc9f9fe8d97fdd01f0e39ba7676867.tar.gz bugs-7f446ae898dc9f9fe8d97fdd01f0e39ba7676867.tar.bz2 bugs-7f446ae898dc9f9fe8d97fdd01f0e39ba7676867.tar.xz bugs-7f446ae898dc9f9fe8d97fdd01f0e39ba7676867.zip |
Bug 313531: Move 'use Bugzilla;' out of globals.pl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
-rw-r--r-- | Bugzilla/Chart.pm | 9 | ||||
-rwxr-xr-x | buglist.cgi | 2 | ||||
-rwxr-xr-x | customfield.pl | 1 | ||||
-rwxr-xr-x | editparams.cgi | 1 | ||||
-rwxr-xr-x | editversions.cgi | 1 | ||||
-rwxr-xr-x | editwhines.cgi | 1 | ||||
-rw-r--r-- | globals.pl | 12 | ||||
-rwxr-xr-x | index.cgi | 1 | ||||
-rwxr-xr-x | query.cgi | 1 | ||||
-rwxr-xr-x | quips.cgi | 1 | ||||
-rwxr-xr-x | sanitycheck.cgi | 2 | ||||
-rwxr-xr-x | sidebar.cgi | 3 | ||||
-rwxr-xr-x | testserver.pl | 16 | ||||
-rwxr-xr-x | whine.pl | 1 |
14 files changed, 30 insertions, 22 deletions
diff --git a/Bugzilla/Chart.pm b/Bugzilla/Chart.pm index a0853d508..c878186bc 100644 --- a/Bugzilla/Chart.pm +++ b/Bugzilla/Chart.pm @@ -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; } diff --git a/buglist.cgi b/buglist.cgi index 8465cae32..5d56c2255 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -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"; diff --git a/customfield.pl b/customfield.pl index 106c60582..101bac880 100755 --- a/customfield.pl +++ b/customfield.pl @@ -29,6 +29,7 @@ use strict; use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Field; use Getopt::Long; diff --git a/editparams.cgi b/editparams.cgi index 487208b47..bb8fa591b 100755 --- a/editparams.cgi +++ b/editparams.cgi @@ -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; diff --git a/editversions.cgi b/editversions.cgi index c060657d2..dec675b5b 100755 --- a/editversions.cgi +++ b/editversions.cgi @@ -33,6 +33,7 @@ use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Constants; use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Product; diff --git a/editwhines.cgi b/editwhines.cgi index 8086862d2..0db643552 100755 --- a/editwhines.cgi +++ b/editwhines.cgi @@ -30,6 +30,7 @@ use strict; use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Constants; use Bugzilla::User; use Bugzilla::Group; diff --git a/globals.pl b/globals.pl index 2654c4a1f..146b51550 100644 --- a/globals.pl +++ b/globals.pl @@ -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; @@ -32,6 +32,7 @@ use strict; use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Constants; use Bugzilla::Update; @@ -30,6 +30,7 @@ use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Bug; use Bugzilla::Constants; use Bugzilla::Search; @@ -29,6 +29,7 @@ use lib qw(.); require "globals.pl"; +use Bugzilla; use Bugzilla::Constants; my $user = Bugzilla->login(LOGIN_REQUIRED); diff --git a/sanitycheck.cgi b/sanitycheck.cgi index b887deeff..7a74bfc07 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -28,6 +28,8 @@ use strict; use lib qw(.); require "globals.pl"; + +use Bugzilla; use Bugzilla::Constants; use Bugzilla::Util; use Bugzilla::User; diff --git a/sidebar.cgi b/sidebar.cgi index 2f7743ebb..671e44c7d 100755 --- a/sidebar.cgi +++ b/sidebar.cgi @@ -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; diff --git a/testserver.pl b/testserver.pl index 0d1d08ba5..2211f8bfe 100755 --- a/testserver.pl +++ b/testserver.pl @@ -18,17 +18,23 @@ # 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"; @@ -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; |