use parent qw(Exporter);
-our @EXPORT = qw(
+our @EXPORT_OK = qw(
WS_ERROR_CODE
STATUS_OK
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;
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;
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;
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;
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;
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;
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;
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;
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 {