@Bugzilla::Error::EXPORT = qw(ThrowCodeError ThrowTemplateError ThrowUserError);
-use Bugzilla::Config;
+use Bugzilla::Config qw($datadir);
use Bugzilla::Constants;
use Bugzilla::Util;
use Date::Format;
# and the transaction is rolled back (if supported)
Bugzilla->dbh->bz_unlock_tables(UNLOCK_ABORT);
- # If a writable data/errorlog exists, log error details there.
- if (-w "data/errorlog") {
+ # If a writable $datadir/errorlog exists, log error details there.
+ if (-w "$datadir/errorlog") {
require Data::Dumper;
my $mesg = "";
for (1..75) { $mesg .= "-"; };
$val = "*****" if $val =~ /password|http_pass/i;
$mesg .= "[$$] " . Data::Dumper->Dump([$val],["env($var)"]);
}
- open(ERRORLOGFID, ">>data/errorlog");
+ open(ERRORLOGFID, ">>$datadir/errorlog");
print ERRORLOGFID "$mesg\n";
close ERRORLOGFID;
}
use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::Error;
-use Bugzilla::Config;
+use Bugzilla::Config qw($datadir);
require "globals.pl";
$sth->execute($classification,$description);
# Make versioncache flush
- unlink "data/versioncache";
+ unlink "$datadir/versioncache";
LoadTemplate($action);
}
$dbh->bz_unlock_tables();
- unlink "data/versioncache";
+ unlink "$datadir/versioncache";
LoadTemplate($action);
}
$dbh->bz_unlock_tables();
- unlink "data/versioncache";
+ unlink "$datadir/versioncache";
LoadTemplate($action);
}
# issues as possible.
use Socket;
+use Bugzilla::Config qw($datadir);
my $envpath = $ENV{'PATH'};
use lib ".";
use strict;
$image->fill(50, 50, $red);
if ($image->can('png')) {
- create_file('data/testgd-local.png', $image->png);
- check_image('data/testgd-local.png', 't/testgd.png', 'GD', 'PNG');
+ create_file("$datadir/testgd-local.png", $image->png);
+ check_image("$datadir/testgd-local.png", 't/testgd.png', 'GD', 'PNG');
} else {
die "GD doesn't support PNG generation\n";
}
$chart->add_pt('bar', 16, 32);
my $type = $chart->can('gif') ? 'gif' : 'png';
- $chart->$type("data/testchart-local.$type");
- check_image("data/testchart-local.$type", "t/testchart.$type",
+ $chart->$type("$datadir/testchart-local.$type");
+ check_image("$datadir/testchart-local.$type", "t/testchart.$type",
"Chart", uc($type));
};
if ($@ ne '') {