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,
libglib-perl,
libhtml-template-perl,
libio-string-perl,
libjson-perl,
libjson-maybexs-perl,
liblasso-perl (>= 2.3.0),
libmime-lite-perl,
libmouse-perl,
......@@ -158,6 +158,7 @@ Depends: ${misc:Depends},
libcrypt-rijndael-perl,
libdbi-perl,
libdigest-sha-perl,
libjson-maybexs-perl,
libmouse-perl,
libnet-cidr-lite-perl,
libsoap-lite-perl
......@@ -189,7 +190,7 @@ Depends: ${misc:Depends},
libconvert-pem-perl,
libcrypt-openssl-rsa-perl,
libhtml-template-perl,
libjson-perl,
libjson-maybexs-perl,
liblemonldap-ng-common-perl (= ${binary:Version}),
liblemonldap-ng-handler-perl (= ${binary:Version}),
libplack-perl,
......
......@@ -34,6 +34,7 @@ WriteMakefile(
'Apache::Session::Browseable' => 0,
'HTML::Template' => 0,
'HTTP::Message' => 0,
'JSON::MaybeXS' => 0,
'Net::LDAP' => 0,
'XML::Simple' => 0,
'XML::LibXML' => 0,
......
......@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::Apache::Session::Serialize::JSON;
use strict;
use vars qw($VERSION);
use JSON;
use JSON::MaybeXS;
our $VERSION = '1.9.0';
......
......@@ -2,6 +2,7 @@ package Lemonldap::NG::Common::Conf::File;
use strict;
use Lemonldap::NG::Common::Conf::Constants; #inherits
use JSON::MaybeXS;
our $VERSION = '1.4.0';
our $initDone;
......@@ -18,14 +19,6 @@ sub Lemonldap::NG::Common::Conf::_file {
sub prereq {
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} ) {
$Lemonldap::NG::Common::Conf::msg .=
'"dirName" is required in "File" configuration type ! \n';
......
......@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::PSGI;
use 5.10.0;
use Mouse;
use JSON;
use JSON::MaybeXS;
use Lemonldap::NG::Common::PSGI::Constants;
use Lemonldap::NG::Common::PSGI::Request;
......
......@@ -2,7 +2,7 @@ package Lemonldap::NG::Common::PSGI::Request;
use strict;
use Mouse;
use JSON;
use JSON::MaybeXS;
use URI::Escape;
our $VERSION = '1.9.0';
......
......@@ -16,7 +16,7 @@ WriteMakefile(
'Convert::PEM' => 0,
'Crypt::OpenSSL::RSA' => 0,
'HTML::Template' => 0,
'JSON' => 0,
'JSON::MaybeXS' => 0,
'Lemonldap::NG::Common' => '1.9.0',
'Lemonldap::NG::Handler' => '1.9.0',
'LWP' => 0,
......
......@@ -7,7 +7,7 @@ use Lemonldap::NG::Manager::Build::Tree;
use Lemonldap::NG::Manager::Build::CTrees;
use Data::Dumper;
use Regexp::Assemble;
use JSON;
use JSON::MaybeXS;
use Getopt::Std;
use IO::String;
......
#!/usr/bin/env perl -I pl/lib
use Test::More;
use JSON;
use strict;
use 5.10.0;
......
#!/usr/bin/env perl -I pl/lib
use Test::More;
use JSON;
use JSON::MaybeXS;
use strict;
use 5.10.0;
......
......@@ -3,7 +3,7 @@
use Test::More;
use 5.10.0;
use strict;
use JSON;
use JSON::MaybeXS;
use IO::String;
require 't/test-lib.pm';
......
......@@ -3,7 +3,7 @@
use Test::More;
use 5.10.0;
use strict;
use JSON;
use JSON::MaybeXS;
use Data::Dumper;
require 't/test-lib.pm';
......
......@@ -3,7 +3,7 @@
use Test::More;
use 5.10.0;
use strict;
use JSON;
use JSON::MaybeXS;
use Data::Dumper;
require 't/test-lib.pm';
......
#!/usr/bin/env perl -I pl/lib
use Test::More;
use JSON::MaybeXS;
use strict;
use 5.10.0;
use Lemonldap::NG::Common::Session;
......@@ -145,7 +146,7 @@ foreach (@ids) {
my $res;
ok( $res = del("/sessions/global/$_"), "Delete $_" );
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' );
count(3);
}
......
#!/usr/bin/env perl -I pl/lib
use Test::More;
use JSON;
use JSON::MaybeXS;
use strict;
use 5.10.0;
......
# Common tests lib
use JSON;
use JSON::MaybeXS;
use 5.10.0;
use Data::Dumper;
......
......@@ -13,6 +13,7 @@ WriteMakefile(
'DBI' => 0,
'Glib' => 0,
'HTTP::Message' => 0,
'JSON::MaybeXS' => 0,
'Lasso' => '2.3.0',
'Lemonldap::NG::Handler' => '1.9.0',
'LWP' => 0,
......
......@@ -3,7 +3,7 @@
# Simple OpenID Connect client
use strict;
use JSON;
use JSON::MaybeXS;
use LWP::UserAgent;
use MIME::Base64
qw/encode_base64url encode_base64 decode_base64url decode_base64/;
......
#!/usr/bin/perl
use Lemonldap::NG::Portal::SharedConf;
use JSON;
use JSON::MaybeXS;
use strict;
my $portal = Lemonldap::NG::Portal::SharedConf->new();
......
......@@ -9,7 +9,7 @@ use strict;
use Lemonldap::NG::Portal::Simple;
use Lemonldap::NG::Portal::_Browser;
use HTTP::Request;
use JSON;
use JSON::MaybeXS;
our @ISA = (qw(Lemonldap::NG::Portal::_Browser));
our $VERSION = '1.3.0';
......@@ -96,7 +96,7 @@ sub extractFormInfo {
"Received BrowserID answer: " . $self->{browserIdAnswerRaw},
'debug' );
my $json = new JSON();
my $json = JSON->new();
$self->{browserIdAnswer} =
$json->decode( $self->{browserIdAnswerRaw} );
......
......@@ -6,7 +6,7 @@
package Lemonldap::NG::Portal::_OpenIDConnect;
use strict;
use JSON;
use JSON::MaybeXS;
use MIME::Base64
qw/encode_base64url encode_base64 decode_base64url decode_base64/;
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