Bug 1153125: bug 1051056 causes "Constant subroutine redefined" warnings during t/001compile.t

r=LpSolit,a=glob


git-svn-id: svn://10.0.0.236/trunk@265926 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2015-04-13 14:15:49 +00:00
parent 2c4def7321
commit 99f15e4b9f
12 changed files with 18 additions and 17 deletions

View File

@ -1 +1 @@
9379
9380

View File

@ -1 +1 @@
7d0c10e71498f2909f466fc0ccda1890595bd3ff
d6c2d37b69eb19b0f0136112d1da45dadb42cbb4

View File

@ -15,7 +15,7 @@ use Bugzilla::Hook;
use parent qw(Exporter);
our @EXPORT = qw(
our @EXPORT_OK = qw(
WS_ERROR_CODE
STATUS_OK

View File

@ -11,7 +11,7 @@ use 5.10.1;
use strict;
use warnings;
use Bugzilla::API::1_0::Constants;
use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
use Bugzilla::API::1_0::Util;
use Bugzilla::Comment;

View File

@ -11,7 +11,7 @@ use 5.10.1;
use strict;
use warnings;
use Bugzilla::API::1_0::Constants;
use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
use Bugzilla::API::1_0::Util;
use Bugzilla::Component;

View File

@ -11,7 +11,7 @@ use 5.10.1;
use strict;
use warnings;
use Bugzilla::API::1_0::Constants;
use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
use Bugzilla::API::1_0::Util;
use Bugzilla::Component;

View File

@ -11,7 +11,7 @@ use 5.10.1;
use strict;
use warnings;
use Bugzilla::API::1_0::Constants;
use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
use Bugzilla::API::1_0::Util;
use Bugzilla::Constants;

View File

@ -11,7 +11,7 @@ use 5.10.1;
use strict;
use warnings;
use Bugzilla::API::1_0::Constants;
use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
use Bugzilla::API::1_0::Util;
use Bugzilla::Product;

View File

@ -11,7 +11,7 @@ use 5.10.1;
use strict;
use warnings;
use Bugzilla::API::1_0::Constants;
use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
use Bugzilla::API::1_0::Util;
use Bugzilla::Constants;

View File

@ -11,7 +11,7 @@ use 5.10.1;
use strict;
use warnings;
use Bugzilla::API::1_0::Constants;
use Bugzilla::API::1_0::Constants qw(API_AUTH_HEADERS);
use Bugzilla::API::1_0::Util qw(taint_data fix_credentials api_include_exclude);
use Bugzilla::Constants;

View File

@ -11,7 +11,7 @@ use 5.10.1;
use strict;
use warnings;
use Bugzilla::API::1_0::Constants;
use Bugzilla::API::1_0::Constants qw(API_AUTH_HEADERS);
use Bugzilla::Error;
use Bugzilla::Flag;
use Bugzilla::FlagType;

View File

@ -95,25 +95,26 @@ sub server {
sub constants {
my ($self) = @_;
my $api_version = $self->api_version;
return $self->{_constants} if defined $self->{_constants};
no strict 'refs';
my $api_version = $self->api_version;
my $class = "Bugzilla::API::${api_version}::Constants";
require_module($class);
my %constants;
foreach my $constant (@{$class . "::EXPORT"}, @{$class . "::EXPORT_OK"}) {
$self->{_constants} = {};
foreach my $constant (@{$class . "::EXPORT_OK"}) {
if (ref $class->$constant) {
$constants{$constant} = $class->$constant;
$self->{_constants}->{$constant} = $class->$constant;
}
else {
my @list = ($class->$constant);
$constants{$constant} = (scalar(@list) == 1) ? $list[0] : \@list;
$self->{_constants}->{$constant} = (scalar(@list) == 1) ? $list[0] : \@list;
}
}
return \%constants;
return $self->{_constants};
}
sub response_header {