Bug 313531: Move 'use Bugzilla;' out of globals.pl - Patch by Fr�d�ric Buclin <LpSolit@gmail.com> r=mkanat a=myk

This commit is contained in:
lpsolit%gmail.com 2006-06-20 07:55:39 +00:00
parent 4433df7eec
commit f2c62770e7
14 changed files with 30 additions and 22 deletions

View 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;
}

View File

@ -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";

View File

@ -29,6 +29,7 @@ use strict;
use lib ".";
require "globals.pl";
use Bugzilla;
use Bugzilla::Field;
use Getopt::Long;

View File

@ -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;

View File

@ -33,6 +33,7 @@ use lib ".";
require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir);
use Bugzilla::Product;

View File

@ -30,6 +30,7 @@ use strict;
use lib ".";
require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::User;
use Bugzilla::Group;

View 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;

View File

@ -32,6 +32,7 @@ use strict;
use lib ".";
require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Update;

View File

@ -30,6 +30,7 @@ use lib ".";
require "globals.pl";
use Bugzilla;
use Bugzilla::Bug;
use Bugzilla::Constants;
use Bugzilla::Search;

View File

@ -29,6 +29,7 @@ use lib qw(.);
require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
my $user = Bugzilla->login(LOGIN_REQUIRED);

View File

@ -28,6 +28,8 @@ use strict;
use lib qw(.);
require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::User;

View File

@ -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;

View File

@ -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";

View File

@ -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;