diff --git a/lib/Catalyst/Plugin/RapidApp/NavCore/Controller.pm b/lib/Catalyst/Plugin/RapidApp/NavCore/Controller.pm index e586b0a7..bf11537d 100644 --- a/lib/Catalyst/Plugin/RapidApp/NavCore/Controller.pm +++ b/lib/Catalyst/Plugin/RapidApp/NavCore/Controller.pm @@ -8,7 +8,7 @@ use RapidApp::Util qw(:all); require Module::Runtime; require Catalyst::Utils; -use JSON qw(decode_json); +use JSON::MaybeXS qw(decode_json); # Controller for loading a saved search in CoreSchema via ID diff --git a/lib/RapidApp/JSON/MixedEncoder.pm b/lib/RapidApp/JSON/MixedEncoder.pm index 18c5bbb3..50335dc2 100644 --- a/lib/RapidApp/JSON/MixedEncoder.pm +++ b/lib/RapidApp/JSON/MixedEncoder.pm @@ -40,12 +40,12 @@ our %SCALARREF_VALUE_MAP = ( # --- -# copied from JSON::PP +# copied from JSON::PP, but match prototypes to Cpanel::JSON::XS. my $JSON; # cache -sub encode_json ($) { # encode +sub encode_json ($;$) { # encode ($JSON ||= __PACKAGE__->new)->encode($_[0]); } -sub decode_json ($) { # decode +sub decode_json ($;$$) { # decode ($JSON ||= __PACKAGE__->new)->decode($_[0]); } diff --git a/lib/RapidApp/Test.pm b/lib/RapidApp/Test.pm index 9628b83a..2cf07bd2 100644 --- a/lib/RapidApp/Test.pm +++ b/lib/RapidApp/Test.pm @@ -7,7 +7,7 @@ use Import::Into; use Time::HiRes qw(gettimeofday tv_interval); use HTTP::Request::Common; -use JSON qw(decode_json); +use JSON::MaybeXS qw(decode_json); use Catalyst::Utils; use RapidApp::Test::Client; diff --git a/lib/RapidApp/Test/Client.pm b/lib/RapidApp/Test/Client.pm index 2f8222f4..acdd43f5 100644 --- a/lib/RapidApp/Test/Client.pm +++ b/lib/RapidApp/Test/Client.pm @@ -13,7 +13,7 @@ use Scalar::Util qw(blessed); use Time::HiRes qw(gettimeofday tv_interval); use LWP::UserAgent; use HTTP::Request::Common; -use JSON qw(decode_json); +use JSON::MaybeXS qw(decode_json); use Try::Tiny; # shorthand aliases: diff --git a/lib/RapidApp/Util/MetaKeys.pm b/lib/RapidApp/Util/MetaKeys.pm index 3840c17f..df7d7e2c 100644 --- a/lib/RapidApp/Util/MetaKeys.pm +++ b/lib/RapidApp/Util/MetaKeys.pm @@ -9,7 +9,7 @@ use Types::Standard qw(:all); use Scalar::Util qw(blessed); use RapidApp::Util::MetaKeys::FK; -use JSON qw( from_json -support_by_pp ); +use JSON::MaybeXS qw( from_json ); use Path::Class qw( file dir ); use Try::Tiny;