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:
parent
2c4def7321
commit
99f15e4b9f
@ -1 +1 @@
|
|||||||
9379
|
9380
|
||||||
@ -1 +1 @@
|
|||||||
7d0c10e71498f2909f466fc0ccda1890595bd3ff
|
d6c2d37b69eb19b0f0136112d1da45dadb42cbb4
|
||||||
@ -15,7 +15,7 @@ use Bugzilla::Hook;
|
|||||||
|
|
||||||
use parent qw(Exporter);
|
use parent qw(Exporter);
|
||||||
|
|
||||||
our @EXPORT = qw(
|
our @EXPORT_OK = qw(
|
||||||
WS_ERROR_CODE
|
WS_ERROR_CODE
|
||||||
|
|
||||||
STATUS_OK
|
STATUS_OK
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use 5.10.1;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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::API::1_0::Util;
|
||||||
|
|
||||||
use Bugzilla::Comment;
|
use Bugzilla::Comment;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use 5.10.1;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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::API::1_0::Util;
|
||||||
|
|
||||||
use Bugzilla::Component;
|
use Bugzilla::Component;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use 5.10.1;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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::API::1_0::Util;
|
||||||
|
|
||||||
use Bugzilla::Component;
|
use Bugzilla::Component;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use 5.10.1;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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::API::1_0::Util;
|
||||||
|
|
||||||
use Bugzilla::Constants;
|
use Bugzilla::Constants;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use 5.10.1;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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::API::1_0::Util;
|
||||||
|
|
||||||
use Bugzilla::Product;
|
use Bugzilla::Product;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use 5.10.1;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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::API::1_0::Util;
|
||||||
|
|
||||||
use Bugzilla::Constants;
|
use Bugzilla::Constants;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use 5.10.1;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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::API::1_0::Util qw(taint_data fix_credentials api_include_exclude);
|
||||||
|
|
||||||
use Bugzilla::Constants;
|
use Bugzilla::Constants;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use 5.10.1;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Bugzilla::API::1_0::Constants;
|
use Bugzilla::API::1_0::Constants qw(API_AUTH_HEADERS);
|
||||||
use Bugzilla::Error;
|
use Bugzilla::Error;
|
||||||
use Bugzilla::Flag;
|
use Bugzilla::Flag;
|
||||||
use Bugzilla::FlagType;
|
use Bugzilla::FlagType;
|
||||||
|
|||||||
@ -95,25 +95,26 @@ sub server {
|
|||||||
|
|
||||||
sub constants {
|
sub constants {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
my $api_version = $self->api_version;
|
return $self->{_constants} if defined $self->{_constants};
|
||||||
|
|
||||||
no strict 'refs';
|
no strict 'refs';
|
||||||
|
|
||||||
|
my $api_version = $self->api_version;
|
||||||
my $class = "Bugzilla::API::${api_version}::Constants";
|
my $class = "Bugzilla::API::${api_version}::Constants";
|
||||||
require_module($class);
|
require_module($class);
|
||||||
|
|
||||||
my %constants;
|
$self->{_constants} = {};
|
||||||
foreach my $constant (@{$class . "::EXPORT"}, @{$class . "::EXPORT_OK"}) {
|
foreach my $constant (@{$class . "::EXPORT_OK"}) {
|
||||||
if (ref $class->$constant) {
|
if (ref $class->$constant) {
|
||||||
$constants{$constant} = $class->$constant;
|
$self->{_constants}->{$constant} = $class->$constant;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my @list = ($class->$constant);
|
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 {
|
sub response_header {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user