Commit 7f446ae8 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 313531: Move 'use Bugzilla;' out of globals.pl - Patch by Frédéric Buclin…

Bug 313531: Move 'use Bugzilla;' out of globals.pl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
parent 5ffe3d31
......@@ -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;
}
......
......@@ -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";
......
......@@ -29,6 +29,7 @@ use strict;
use lib ".";
require "globals.pl";
use Bugzilla;
use Bugzilla::Field;
use Getopt::Long;
......
......@@ -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;
......
......@@ -33,6 +33,7 @@ use lib ".";
require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir);
use Bugzilla::Product;
......
......@@ -30,6 +30,7 @@ use strict;
use lib ".";
require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::User;
use Bugzilla::Group;
......
......@@ -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);
......
......@@ -28,6 +28,8 @@ use strict;
use lib qw(.);
require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::User;
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment