summaryrefslogtreecommitdiffstats
path: root/Bugzilla/API
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2015-04-13 15:59:31 +0200
committerDavid Lawrence <dkl@mozilla.com>2015-04-13 15:59:31 +0200
commitd6c2d37b69eb19b0f0136112d1da45dadb42cbb4 (patch)
tree34f58b12c337f0d7810d95d3ea22c6ce772c2d91 /Bugzilla/API
parent7d0c10e71498f2909f466fc0ccda1890595bd3ff (diff)
downloadbugzilla-d6c2d37b69eb19b0f0136112d1da45dadb42cbb4.tar.gz
bugzilla-d6c2d37b69eb19b0f0136112d1da45dadb42cbb4.tar.xz
Bug 1153125: bug 1051056 causes "Constant subroutine redefined" warnings during t/001compile.t
r=LpSolit,a=glob
Diffstat (limited to 'Bugzilla/API')
-rw-r--r--Bugzilla/API/1_0/Constants.pm2
-rw-r--r--Bugzilla/API/1_0/Resource/Bug.pm2
-rw-r--r--Bugzilla/API/1_0/Resource/Component.pm2
-rw-r--r--Bugzilla/API/1_0/Resource/FlagType.pm2
-rw-r--r--Bugzilla/API/1_0/Resource/Group.pm2
-rw-r--r--Bugzilla/API/1_0/Resource/Product.pm2
-rw-r--r--Bugzilla/API/1_0/Resource/User.pm2
-rw-r--r--Bugzilla/API/1_0/Server.pm2
-rw-r--r--Bugzilla/API/1_0/Util.pm2
-rw-r--r--Bugzilla/API/Server.pm13
10 files changed, 16 insertions, 15 deletions
diff --git a/Bugzilla/API/1_0/Constants.pm b/Bugzilla/API/1_0/Constants.pm
index caf670c7b..44e20124a 100644
--- a/Bugzilla/API/1_0/Constants.pm
+++ b/Bugzilla/API/1_0/Constants.pm
@@ -15,7 +15,7 @@ use Bugzilla::Hook;
use parent qw(Exporter);
-our @EXPORT = qw(
+our @EXPORT_OK = qw(
WS_ERROR_CODE
STATUS_OK
diff --git a/Bugzilla/API/1_0/Resource/Bug.pm b/Bugzilla/API/1_0/Resource/Bug.pm
index c61b2c6c2..8bdf9ae2d 100644
--- a/Bugzilla/API/1_0/Resource/Bug.pm
+++ b/Bugzilla/API/1_0/Resource/Bug.pm
@@ -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;
diff --git a/Bugzilla/API/1_0/Resource/Component.pm b/Bugzilla/API/1_0/Resource/Component.pm
index c3bdc0386..96c2a3dcd 100644
--- a/Bugzilla/API/1_0/Resource/Component.pm
+++ b/Bugzilla/API/1_0/Resource/Component.pm
@@ -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;
diff --git a/Bugzilla/API/1_0/Resource/FlagType.pm b/Bugzilla/API/1_0/Resource/FlagType.pm
index 297be1510..702b4d4ec 100644
--- a/Bugzilla/API/1_0/Resource/FlagType.pm
+++ b/Bugzilla/API/1_0/Resource/FlagType.pm
@@ -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;
diff --git a/Bugzilla/API/1_0/Resource/Group.pm b/Bugzilla/API/1_0/Resource/Group.pm
index aee8a7492..4efd7b476 100644
--- a/Bugzilla/API/1_0/Resource/Group.pm
+++ b/Bugzilla/API/1_0/Resource/Group.pm
@@ -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;
diff --git a/Bugzilla/API/1_0/Resource/Product.pm b/Bugzilla/API/1_0/Resource/Product.pm
index 0f393e207..dcd4b9a68 100644
--- a/Bugzilla/API/1_0/Resource/Product.pm
+++ b/Bugzilla/API/1_0/Resource/Product.pm
@@ -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;
diff --git a/Bugzilla/API/1_0/Resource/User.pm b/Bugzilla/API/1_0/Resource/User.pm
index d2c869907..8b4e99e2e 100644
--- a/Bugzilla/API/1_0/Resource/User.pm
+++ b/Bugzilla/API/1_0/Resource/User.pm
@@ -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;
diff --git a/Bugzilla/API/1_0/Server.pm b/Bugzilla/API/1_0/Server.pm
index 108c25e27..83d09c401 100644
--- a/Bugzilla/API/1_0/Server.pm
+++ b/Bugzilla/API/1_0/Server.pm
@@ -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;
diff --git a/Bugzilla/API/1_0/Util.pm b/Bugzilla/API/1_0/Util.pm
index 2d83e1d2d..d22935f6e 100644
--- a/Bugzilla/API/1_0/Util.pm
+++ b/Bugzilla/API/1_0/Util.pm
@@ -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;
diff --git a/Bugzilla/API/Server.pm b/Bugzilla/API/Server.pm
index 439f6e743..496901037 100644
--- a/Bugzilla/API/Server.pm
+++ b/Bugzilla/API/Server.pm
@@ -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 {