use Bugzilla::Series;
use Date::Format;
+use Date::Parse;
sub new {
my $invocant = shift;
# 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}});
}
}
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'};
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'};
$dateto += (2 * $oneday) / 3;
while ($datefrom < $dateto) {
- push (@progression, &::time2str("%Y-%m-%d", $datefrom));
+ push (@progression, time2str("%Y-%m-%d", $datefrom));
$datefrom += $oneday;
}
# 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;
# 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";