From c41117346f48774e5c6731303702b5ce98db517b Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 21 Jun 2006 07:44:46 +0000 Subject: Bug 282121: Remove globals.pl from scripts that no longer use it - Patch by Frédéric Buclin r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- attachment.cgi | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index c79ebf2cb..7acc6e326 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -37,12 +37,10 @@ use strict; use lib qw(.); -# Include the Bugzilla CGI and general utility library. -require "globals.pl"; - use Bugzilla; -use Bugzilla::Config qw(:locations); +use Bugzilla::Config qw(:DEFAULT :localconfig); use Bugzilla::Constants; +use Bugzilla::Error; use Bugzilla::Flag; use Bugzilla::FlagType; use Bugzilla::User; @@ -371,7 +369,7 @@ sub view { my $hash = ($attach_id % 100) + 100; $hash =~ s/.*(\d\d)$/group.$1/; - if (open(AH, "$attachdir/$hash/attachment.$attach_id")) { + if (open(AH, bz_locations()->{'attachdir'} . "/$hash/attachment.$attach_id")) { binmode AH; $filesize = (stat(AH))[7]; } @@ -424,8 +422,8 @@ sub interdiff # # Must hack path so that interdiff will work. # - $ENV{'PATH'} = $::diffpath; - open my $interdiff_fh, "$::interdiffbin $old_filename $new_filename|"; + $ENV{'PATH'} = $diffpath; + open my $interdiff_fh, "$interdiffbin $old_filename $new_filename|"; binmode $interdiff_fh; my ($reader, $last_reader) = setup_patch_readers("", $context); if ($format eq 'raw') @@ -558,7 +556,7 @@ sub setup_patch_readers { $last_reader = $last_reader->sends_data_to; } # Add in cvs context if we have the necessary info to do it - if ($context ne "patch" && $::cvsbin && Param('cvsroot_get')) + if ($context ne "patch" && $cvsbin && Param('cvsroot_get')) { require PatchReader::AddCVSContext; $last_reader->sends_data_to( @@ -583,7 +581,7 @@ sub setup_template_patch_reader } $vars->{collapsed} = $cgi->param('collapsed'); $vars->{context} = $context; - $vars->{do_context} = $::cvsbin && Param('cvsroot_get') && !$vars->{'newid'}; + $vars->{do_context} = $cvsbin && Param('cvsroot_get') && !$vars->{'newid'}; # Print everything out print $cgi->header(-type => 'text/html', @@ -634,7 +632,7 @@ sub diff else { $vars->{other_patches} = []; - if ($::interdiffbin && $::diffpath) { + if ($interdiffbin && $diffpath) { # Get list of attachments on this bug. # Ignore the current patch, but select the one right before it # chronologically. -- cgit v1.2.3-24-g4f1b