JSON::XS -> Cpanel::JSON::XS
authorIvan Kohler <ivan@freeside.biz>
Sun, 13 Dec 2015 23:28:57 +0000 (15:28 -0800)
committerMitch Jackson <mitch@freeside.biz>
Tue, 9 Oct 2018 22:35:53 +0000 (18:35 -0400)
14 files changed:
FS/FS/Mason.pm
FS/FS/Misc/Geo.pm
FS/FS/UI/Web.pm
FS/FS/deploy_zone.pm
FS/FS/part_event/Action/http.pm
FS/FS/part_export/pbxware.pm
FS/FS/part_export/thinktel.pm
FS/FS/part_export/voip_ms.pm
FS/bin/freeside-cdr-portaone-import
debian/control
httemplate/edit/payment_gateway.html
httemplate/elements/htmlarea.html
httemplate/elements/select-tiered.html
httemplate/misc/xmlhttp-mib-browse.html

index 5beb100..dd9c57a 100644 (file)
@@ -77,8 +77,7 @@ if ( -e $addl_handler_use_file ) {
   use HTML::TableExtract qw(tree);
   use HTML::FormatText;
   use HTML::Defang;
-#  use JSON::XS;        ! Maintainers deployed app-breaking defaults,
-  use Cpanel::JSON::XS; # this is considered safe compatible drop-in replacement
+  use Cpanel::JSON::XS;
 #  use XMLRPC::Transport::HTTP;
 #  use XMLRPC::Lite; # for XMLRPC::Serializer
   use MIME::Base64;
index 2050fdf..8533e37 100644 (file)
@@ -8,7 +8,7 @@ use HTTP::Request;
 use HTTP::Request::Common qw( GET POST );
 use IO::Socket::SSL;
 use HTML::TokeParser;
-use JSON;
+use Cpanel::JSON::XS;
 use URI::Escape 3.31;
 use Data::Dumper;
 use FS::Conf;
index 43a3872..d811759 100644 (file)
@@ -739,8 +739,7 @@ use vars qw($DEBUG);
 use Carp;
 use Storable qw(nfreeze);
 use MIME::Base64;
-#use JSON::XS;        ! maintainers deployed app breaking changes
-use Cpanel::JSON::XS; # safe, compatible drop-in replacement
+use Cpanel::JSON::XS;
 use FS::UID qw(getotaker);
 use FS::Record qw(qsearchs);
 use FS::queue;
index 7c3a76c..306b4fb 100644 (file)
@@ -6,7 +6,7 @@ use FS::Record qw( qsearch qsearchs dbh );
 use Storable qw(thaw);
 use MIME::Base64;
 
-use Cpanel::JSON::XS qw(encode_json decode_json);
+use Cpanel::JSON::XS;
 use LWP::UserAgent;
 use HTTP::Request::Common;
 
index 10e9bd4..13d13f2 100644 (file)
@@ -6,7 +6,7 @@ use vars qw( $me );
 use IO::Socket::SSL;
 use LWP::UserAgent;
 use HTTP::Request::Common;
-use JSON::XS;
+use Cpanel::JSON::XS;
 use FS::Misc::DateTime qw( iso8601 );
 
 $me = '[FS::part_event::Action::http]';
index c6fc407..e535e6e 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 
 use Tie::IxHash;
 use LWP::UserAgent;
-use JSON;
+use Cpanel::JSON::XS;
 use HTTP::Request::Common;
 use Digest::MD5 qw(md5_hex);
 use FS::Record qw(dbh);
index d208523..67cf2b0 100644 (file)
@@ -7,7 +7,7 @@ use Tie::IxHash;
 use URI::Escape;
 use LWP::UserAgent;
 use URI::Escape;
-use JSON;
+use Cpanel::JSON::XS;
 
 use FS::Record qw( qsearch qsearchs );
 
@@ -214,7 +214,7 @@ sub insert_gateway {
   my $content = {
     ContactIPAddress  => $svc_x->ip_addr,
     ContactPort       => 5060,
-    IPMatchRequired   => JSON::true,
+    IPMatchRequired   => Cpanel::JSON::XS::true,
     SipDomainName     => $self->option('proxy'),
     SipTrunkType      => $self->option('trunktype'),
     SipUsername       => $trunknum,
@@ -270,7 +270,7 @@ sub insert_trunk {
   my $endpoint = "SipTrunks";
   my $content = {
     Account           => $self->option('username'),
-    Enabled           => JSON::true,
+    Enabled           => Cpanel::JSON::XS::true,
     Label             => $svc_x->phone_name_or_cust,
     Locale            => $locales{$self->option('locale')},
     MaxChannels       => $svc_x->max_simultaneous,
@@ -325,7 +325,7 @@ sub replace_trunk {
   my $self = FS::part_export->by_key($exportnum);
   my $svc_x = FS::svc_phone->by_key($svcnum);
 
-  my $enabled = JSON::is_bool( $self->cust_svc->cust_pkg->susp == 0 );
+  my $enabled = Cpanel::JSON::XS::is_bool( $self->cust_svc->cust_pkg->susp == 0 );
 
   my $phonenum = $svc_x->phonenum;
   my $endpoint = "SipTrunks/$phonenum";
@@ -398,7 +398,7 @@ sub replace_gateway {
     ContactIPAddress  => $svc_x->ip_addr,
     ContactPort       => 5060,
     ID                => $binding_id,
-    IPMatchRequired   => JSON::true,
+    IPMatchRequired   => Cpanel::JSON::XS::true,
     Name              => $binding_name,
     SipDomainName     => $self->option('proxy'),
     SipTrunkType      => $self->option('trunktype'),
@@ -606,7 +606,7 @@ have a 'Message' element.
 sub api_request {
   my $self = shift;
   my ($method, $endpoint, $content) = @_;
-  my $json = JSON->new->canonical(1); # hash keys are ordered
+  my $json = Cpanel::JSON::XS->new->canonical(1); # hash keys are ordered
 
   $DEBUG ||= 1 if $self->option('debug');
 
index a23345c..2519884 100644 (file)
@@ -7,7 +7,7 @@ use Tie::IxHash;
 use LWP::UserAgent;
 use URI;
 use URI::Escape;
-use JSON;
+use Cpanel::JSON::XS;
 use HTTP::Request::Common;
 use Cache::FileCache;
 use FS::Record qw(dbh);
index 855f68f..dfd130b 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use Date::Format 'time2str';
 use Date::Parse 'str2time';
 use Getopt::Long;
-use JSON;
+use Cpanel::JSON::XS;
 use Net::HTTPS::Any qw(https_post);
 use Time::Local;
 
index 90a21a3..8e92bf6 100644 (file)
@@ -133,7 +133,7 @@ Description: Integrated network monitoring and billing
 
 Package: freeside-selfservice-ui
 Architecture: all
-Depends: freeside-selfservice-lib,apache2-suexec-custom,apache2
+Depends: freeside-selfservice-lib,apache2-suexec-custom,libjson-perl,apache2
 Description: Self-service portal html/cgi filesfor Freeside billing and trouble ticketing
  Freeside is a web-based billing and trouble ticketing application.
  .
index b28be23..b44b315 100644 (file)
@@ -39,7 +39,7 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
-my $json = JSON::XS->new;
+my $json = Cpanel::JSON::XS->new;
 $json->canonical(1);
 my %modules = (
   'Business::OnlinePayment' => [
index 0ba4177..68acb97 100644 (file)
@@ -32,7 +32,7 @@ Example:
 my %opt = @_;
 my $config = {
   'height'              => ($opt{height} || 420),
-  'startupFocus'        => JSON::true,
+  'startupFocus'        => Cpanel::JSON::XS::true,
   'skin'                => 'kama',
   'toolbarCanCollapse'  => JSON::true,
   'basePath'            => $p.'elements/ckeditor/',
index 9c7dfcf..bdec95c 100644 (file)
@@ -124,7 +124,7 @@ my %opt = @_;
 my $pre = $opt{prefix} || '';
 my $tiers = $opt{tiers} or die "no tiers defined";
 
-my $json = JSON::XS->new();
+my $json = Cpanel::JSON::XS->new();
 $json->canonical;
 $json->allow_nonref(1);
 
index f3084ff..6b00853 100644 (file)
@@ -1,5 +1,5 @@
 %#<% Data::Format::HTML->new->format($index{by_path}) %>
-% my $json = "JSON"->new->canonical;
+% my $json = Cpanel::JSON::XS->new->canonical;
 <% $json->encode($result) %>
 <%init>
 #<%once>  #enable me in production