diff options
author | Norbert Preining <preining@logic.at> | 2017-11-11 07:21:13 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2017-11-11 07:21:13 +0000 |
commit | 340f5c8eff5fb4baaac3b9d9c48aa974f7a489a3 (patch) | |
tree | 8acc98f3a91723f63204ba4bdda21fdc2cce9a85 /Master/tlpkg/TeXLive/TLPOBJ.pm | |
parent | 7dd43e0f528f7f7c28d31cf49699dea37d2539f8 (diff) |
json: dynamically select tl internal or external json mode
git-svn-id: svn://tug.org/texlive/trunk@45745 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPOBJ.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPOBJ.pm | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index 8dadf1723fd..82eaf531ce4 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -423,8 +423,6 @@ sub writeout_simple { sub as_json { my $self = shift; my %addargs = @_; - require JSON; - #my $json = JSON::PP->new->utf8; my %foo = %{$self}; # set the additional args for my $k (keys %addargs) { @@ -445,9 +443,9 @@ sub as_json { # encode boolean as boolean flags if (exists($foo{'relocated'})) { if ($foo{'relocated'}) { - $foo{'relocated'} = $JSON::true; + $foo{'relocated'} = TeXLive::TLUtils::True(); } else { - $foo{'relocated'} = $JSON::false; + $foo{'relocated'} = TeXLive::TLUtils::False(); } } # adjust the docfiles entry to the specification in JSON-formats @@ -469,11 +467,7 @@ sub as_json { $foo{'docfiles'} = [ @newdocf ]; delete($foo{'docfiledata'}); # - # my home-made solution is a bit faster then JSON::PP - # but we still prefer that one for security ;-) - # If JSON::XS is installed, that is the fastest. - #my $utf8_encoded_json_text = TeXLive::TLUtils::hash_to_json(\%foo); - my $utf8_encoded_json_text = JSON::encode_json(\%foo); + my $utf8_encoded_json_text = TeXLive::TLUtils::encode_json(\%foo); return $utf8_encoded_json_text; } |