Commit 0b52c97c authored by Xavier Guimard's avatar Xavier Guimard

Use JSON::MaybeXS instead of JSON

JSON::Any used before as been deprecated
parent db14f3c3
...@@ -20,7 +20,7 @@ Build-Depends-Indep: libapache-session-perl, ...@@ -20,7 +20,7 @@ Build-Depends-Indep: libapache-session-perl,
libglib-perl, libglib-perl,
libhtml-template-perl, libhtml-template-perl,
libio-string-perl, libio-string-perl,
libjson-perl, libjson-maybexs-perl,
liblasso-perl (>= 2.3.0), liblasso-perl (>= 2.3.0),
libmime-lite-perl, libmime-lite-perl,
libmouse-perl, libmouse-perl,
...@@ -158,6 +158,7 @@ Depends: ${misc:Depends}, ...@@ -158,6 +158,7 @@ Depends: ${misc:Depends},
libcrypt-rijndael-perl, libcrypt-rijndael-perl,
libdbi-perl, libdbi-perl,
libdigest-sha-perl, libdigest-sha-perl,
libjson-maybexs-perl,
libmouse-perl, libmouse-perl,
libnet-cidr-lite-perl, libnet-cidr-lite-perl,
libsoap-lite-perl libsoap-lite-perl
...@@ -189,7 +190,7 @@ Depends: ${misc:Depends}, ...@@ -189,7 +190,7 @@ Depends: ${misc:Depends},
libconvert-pem-perl, libconvert-pem-perl,
libcrypt-openssl-rsa-perl, libcrypt-openssl-rsa-perl,
libhtml-template-perl, libhtml-template-perl,
libjson-perl, libjson-maybexs-perl,
liblemonldap-ng-common-perl (= ${binary:Version}), liblemonldap-ng-common-perl (= ${binary:Version}),
liblemonldap-ng-handler-perl (= ${binary:Version}), liblemonldap-ng-handler-perl (= ${binary:Version}),
libplack-perl, libplack-perl,
......
...@@ -34,6 +34,7 @@ WriteMakefile( ...@@ -34,6 +34,7 @@ WriteMakefile(
'Apache::Session::Browseable' => 0, 'Apache::Session::Browseable' => 0,
'HTML::Template' => 0, 'HTML::Template' => 0,
'HTTP::Message' => 0, 'HTTP::Message' => 0,
'JSON::MaybeXS' => 0,
'Net::LDAP' => 0, 'Net::LDAP' => 0,
'XML::Simple' => 0, 'XML::Simple' => 0,
'XML::LibXML' => 0, 'XML::LibXML' => 0,
......
...@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::Apache::Session::Serialize::JSON; ...@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::Apache::Session::Serialize::JSON;
use strict; use strict;
use vars qw($VERSION); use vars qw($VERSION);
use JSON; use JSON::MaybeXS;
our $VERSION = '1.9.0'; our $VERSION = '1.9.0';
......
...@@ -2,6 +2,7 @@ package Lemonldap::NG::Common::Conf::File; ...@@ -2,6 +2,7 @@ package Lemonldap::NG::Common::Conf::File;
use strict; use strict;
use Lemonldap::NG::Common::Conf::Constants; #inherits use Lemonldap::NG::Common::Conf::Constants; #inherits
use JSON::MaybeXS;
our $VERSION = '1.4.0'; our $VERSION = '1.4.0';
our $initDone; our $initDone;
...@@ -18,14 +19,6 @@ sub Lemonldap::NG::Common::Conf::_file { ...@@ -18,14 +19,6 @@ sub Lemonldap::NG::Common::Conf::_file {
sub prereq { sub prereq {
my $self = shift; my $self = shift;
unless ($initDone) {
eval "use JSON";
if ($@) {
$Lemonldap::NG::Common::Conf::msg .= "Unable to load JSON: $@\n";
return 0;
}
$initDone++;
}
unless ( $self->{dirName} ) { unless ( $self->{dirName} ) {
$Lemonldap::NG::Common::Conf::msg .= $Lemonldap::NG::Common::Conf::msg .=
'"dirName" is required in "File" configuration type ! \n'; '"dirName" is required in "File" configuration type ! \n';
......
...@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::PSGI; ...@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::PSGI;
use 5.10.0; use 5.10.0;
use Mouse; use Mouse;
use JSON; use JSON::MaybeXS;
use Lemonldap::NG::Common::PSGI::Constants; use Lemonldap::NG::Common::PSGI::Constants;
use Lemonldap::NG::Common::PSGI::Request; use Lemonldap::NG::Common::PSGI::Request;
......
...@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::PSGI::Request; ...@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::PSGI::Request;
use strict; use strict;
use Mouse; use Mouse;
use JSON; use JSON::MaybeXS;
use URI::Escape; use URI::Escape;
our $VERSION = '1.9.0'; our $VERSION = '1.9.0';
......
...@@ -16,7 +16,7 @@ WriteMakefile( ...@@ -16,7 +16,7 @@ WriteMakefile(
'Convert::PEM' => 0, 'Convert::PEM' => 0,
'Crypt::OpenSSL::RSA' => 0, 'Crypt::OpenSSL::RSA' => 0,
'HTML::Template' => 0, 'HTML::Template' => 0,
'JSON' => 0, 'JSON::MaybeXS' => 0,
'Lemonldap::NG::Common' => '1.9.0', 'Lemonldap::NG::Common' => '1.9.0',
'Lemonldap::NG::Handler' => '1.9.0', 'Lemonldap::NG::Handler' => '1.9.0',
'LWP' => 0, 'LWP' => 0,
......
...@@ -7,7 +7,7 @@ use Lemonldap::NG::Manager::Build::Tree; ...@@ -7,7 +7,7 @@ use Lemonldap::NG::Manager::Build::Tree;
use Lemonldap::NG::Manager::Build::CTrees; use Lemonldap::NG::Manager::Build::CTrees;
use Data::Dumper; use Data::Dumper;
use Regexp::Assemble; use Regexp::Assemble;
use JSON; use JSON::MaybeXS;
use Getopt::Std; use Getopt::Std;
use IO::String; use IO::String;
......
#!/usr/bin/env perl -I pl/lib #!/usr/bin/env perl -I pl/lib
use Test::More; use Test::More;
use JSON;
use strict; use strict;
use 5.10.0; use 5.10.0;
......
#!/usr/bin/env perl -I pl/lib #!/usr/bin/env perl -I pl/lib
use Test::More; use Test::More;
use JSON; use JSON::MaybeXS;
use strict; use strict;
use 5.10.0; use 5.10.0;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
use Test::More; use Test::More;
use 5.10.0; use 5.10.0;
use strict; use strict;
use JSON; use JSON::MaybeXS;
use IO::String; use IO::String;
require 't/test-lib.pm'; require 't/test-lib.pm';
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
use Test::More; use Test::More;
use 5.10.0; use 5.10.0;
use strict; use strict;
use JSON; use JSON::MaybeXS;
use Data::Dumper; use Data::Dumper;
require 't/test-lib.pm'; require 't/test-lib.pm';
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
use Test::More; use Test::More;
use 5.10.0; use 5.10.0;
use strict; use strict;
use JSON; use JSON::MaybeXS;
use Data::Dumper; use Data::Dumper;
require 't/test-lib.pm'; require 't/test-lib.pm';
......
#!/usr/bin/env perl -I pl/lib #!/usr/bin/env perl -I pl/lib
use Test::More; use Test::More;
use JSON::MaybeXS;
use strict; use strict;
use 5.10.0; use 5.10.0;
use Lemonldap::NG::Common::Session; use Lemonldap::NG::Common::Session;
...@@ -145,7 +146,7 @@ foreach (@ids) { ...@@ -145,7 +146,7 @@ foreach (@ids) {
my $res; my $res;
ok( $res = del("/sessions/global/$_"), "Delete $_" ); ok( $res = del("/sessions/global/$_"), "Delete $_" );
ok( $res->[0] == 200, 'Result code is 200' ); ok( $res->[0] == 200, 'Result code is 200' );
ok( JSON::decode_json( $res->[2]->[0] )->{result} == 1, ok( decode_json( $res->[2]->[0] )->{result} == 1,
'Body is JSON and result==1' ); 'Body is JSON and result==1' );
count(3); count(3);
} }
......
#!/usr/bin/env perl -I pl/lib #!/usr/bin/env perl -I pl/lib
use Test::More; use Test::More;
use JSON; use JSON::MaybeXS;
use strict; use strict;
use 5.10.0; use 5.10.0;
......
# Common tests lib # Common tests lib
use JSON; use JSON::MaybeXS;
use 5.10.0; use 5.10.0;
use Data::Dumper; use Data::Dumper;
......
...@@ -13,6 +13,7 @@ WriteMakefile( ...@@ -13,6 +13,7 @@ WriteMakefile(
'DBI' => 0, 'DBI' => 0,
'Glib' => 0, 'Glib' => 0,
'HTTP::Message' => 0, 'HTTP::Message' => 0,
'JSON::MaybeXS' => 0,
'Lasso' => '2.3.0', 'Lasso' => '2.3.0',
'Lemonldap::NG::Handler' => '1.9.0', 'Lemonldap::NG::Handler' => '1.9.0',
'LWP' => 0, 'LWP' => 0,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Simple OpenID Connect client # Simple OpenID Connect client
use strict; use strict;
use JSON; use JSON::MaybeXS;
use LWP::UserAgent; use LWP::UserAgent;
use MIME::Base64 use MIME::Base64
qw/encode_base64url encode_base64 decode_base64url decode_base64/; qw/encode_base64url encode_base64 decode_base64url decode_base64/;
......
#!/usr/bin/perl #!/usr/bin/perl
use Lemonldap::NG::Portal::SharedConf; use Lemonldap::NG::Portal::SharedConf;
use JSON; use JSON::MaybeXS;
use strict; use strict;
my $portal = Lemonldap::NG::Portal::SharedConf->new(); my $portal = Lemonldap::NG::Portal::SharedConf->new();
......
...@@ -9,7 +9,7 @@ use strict; ...@@ -9,7 +9,7 @@ use strict;
use Lemonldap::NG::Portal::Simple; use Lemonldap::NG::Portal::Simple;
use Lemonldap::NG::Portal::_Browser; use Lemonldap::NG::Portal::_Browser;
use HTTP::Request; use HTTP::Request;
use JSON; use JSON::MaybeXS;
our @ISA = (qw(Lemonldap::NG::Portal::_Browser)); our @ISA = (qw(Lemonldap::NG::Portal::_Browser));
our $VERSION = '1.3.0'; our $VERSION = '1.3.0';
...@@ -96,7 +96,7 @@ sub extractFormInfo { ...@@ -96,7 +96,7 @@ sub extractFormInfo {
"Received BrowserID answer: " . $self->{browserIdAnswerRaw}, "Received BrowserID answer: " . $self->{browserIdAnswerRaw},
'debug' ); 'debug' );
my $json = new JSON(); my $json = JSON->new();
$self->{browserIdAnswer} = $self->{browserIdAnswer} =
$json->decode( $self->{browserIdAnswerRaw} ); $json->decode( $self->{browserIdAnswerRaw} );
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
package Lemonldap::NG::Portal::_OpenIDConnect; package Lemonldap::NG::Portal::_OpenIDConnect;
use strict; use strict;
use JSON; use JSON::MaybeXS;
use MIME::Base64 use MIME::Base64
qw/encode_base64url encode_base64 decode_base64url decode_base64/; qw/encode_base64url encode_base64 decode_base64url decode_base64/;
use URI::Escape; use URI::Escape;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment