r58910 - in /branches/upstream/libmediawiki-api-perl/current: Changes META.yml lib/MediaWiki/API.pm
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Sun Jun 6 02:41:23 UTC 2010
Author: ansgar-guest
Date: Sun Jun 6 02:41:06 2010
New Revision: 58910
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=58910
Log:
[svn-upgrade] Integrating new upstream version, libmediawiki-api-perl (0.32)
Modified:
branches/upstream/libmediawiki-api-perl/current/Changes
branches/upstream/libmediawiki-api-perl/current/META.yml
branches/upstream/libmediawiki-api-perl/current/lib/MediaWiki/API.pm
Modified: branches/upstream/libmediawiki-api-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmediawiki-api-perl/current/Changes?rev=58910&op=diff
==============================================================================
--- branches/upstream/libmediawiki-api-perl/current/Changes (original)
+++ branches/upstream/libmediawiki-api-perl/current/Changes Sun Jun 6 02:41:06 2010
@@ -1,4 +1,9 @@
Revision history for MediaWiki-API
+
+0.32 2010-06-05
+ Config options passed when creating a new instance of the mediawiki api object were overwritten with default
+ values. Now fixed. Thanks to Brian for reporting this problem. Note the version number has been bumped twice
+ since I forgot to update this changes file for 0.31. oops.
0.30 2010-04-08
MediaWiki >= 1.15.3 and MediaWiki >= 1.16.0beta2 now require a login token to be sent when logging in. Please
Modified: branches/upstream/libmediawiki-api-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmediawiki-api-perl/current/META.yml?rev=58910&op=diff
==============================================================================
--- branches/upstream/libmediawiki-api-perl/current/META.yml (original)
+++ branches/upstream/libmediawiki-api-perl/current/META.yml Sun Jun 6 02:41:06 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: MediaWiki-API
-version: 0.30
+version: 0.32
abstract: Provides a Perl interface to the MediaWiki API (http://www.mediawiki.org/wiki/API)
author:
- Jools Wills <buzz at exotica.org.uk>
Modified: branches/upstream/libmediawiki-api-perl/current/lib/MediaWiki/API.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmediawiki-api-perl/current/lib/MediaWiki/API.pm?rev=58910&op=diff
==============================================================================
--- branches/upstream/libmediawiki-api-perl/current/lib/MediaWiki/API.pm (original)
+++ branches/upstream/libmediawiki-api-perl/current/lib/MediaWiki/API.pm Sun Jun 6 02:41:06 2010
@@ -40,11 +40,11 @@
=head1 VERSION
-Version 0.30
-
-=cut
-
-our $VERSION = "0.30";
+Version 0.32
+
+=cut
+
+our $VERSION = "0.32";
=head1 SYNOPSIS
@@ -168,6 +168,13 @@
sub new {
my ($class, $config) = @_;
+
+ # if no config passed make a new hash reference and get the default configuration parameters
+ $config = {} if ! defined $config;
+ my $defconfig = _get_config_defaults();
+
+ $config = {%$defconfig, %$config};
+
my $self = { config => $config };
my $ua = LWP::UserAgent->new();
@@ -181,22 +188,29 @@
my $json = JSON->new->utf8()->max_depth(10) ;
$self->{json} = $json;
- # initialise some defaults
+ # initialise error code values
$self->{error}->{code} = 0;
$self->{error}->{details} = '';
$self->{error}->{stacktrace} = '';
- $self->{config}->{retries} = DEF_RETRIES;
- $self->{config}->{retry_delay} = DEF_RETRY_DELAY;
-
- $self->{config}->{max_lag} = DEF_MAX_LAG;
- $self->{config}->{max_lag_retries} = DEF_MAX_LAG_RETRIES;
- $self->{config}->{max_lag_delay} = DEF_MAX_LAG_DELAY;
-
- $self->{config}->{use_http_get} = USE_HTTP_GET;
-
bless ($self, $class);
return $self;
+}
+
+# returns a hashref with configuration defaults
+sub _get_config_defaults {
+ my %config;
+
+ $config{retries} = DEF_RETRIES;
+ $config{retry_delay} = DEF_RETRY_DELAY;
+
+ $config{max_lag} = DEF_MAX_LAG;
+ $config{max_lag_retries} = DEF_MAX_LAG_RETRIES;
+ $config{max_lag_delay} = DEF_MAX_LAG_DELAY;
+
+ $config{use_http_get} = USE_HTTP_GET;
+
+ return \%config;
}
=head2 MediaWiki::API->login( $query_hashref )
More information about the Pkg-perl-cvs-commits
mailing list