Merge pull request #2 from MrStrategy/fix_json_encode

reenabled code and it works out of the box.
This commit is contained in:
Matthias 2022-03-20 21:04:58 +01:00 committed by GitHub
commit a8909ae31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,58 +13,58 @@ use DateTime::Format::Strptime;
# try to use JSON::MaybeXS wrapper # try to use JSON::MaybeXS wrapper
# for chance of better performance + open code # for chance of better performance + open code
#eval { eval {
# require JSON::MaybeXS; require JSON::MaybeXS;
# import JSON::MaybeXS qw( decode_json encode_json ); import JSON::MaybeXS qw( decode_json encode_json );
# 1; 1;
#} or do { } or do {
# try to use JSON wrapper # try to use JSON wrapper
# for chance of better performance # for chance of better performance
# eval { eval {
# JSON preference order # JSON preference order
# local $ENV{PERL_JSON_BACKEND} = local $ENV{PERL_JSON_BACKEND} =
# 'Cpanel::JSON::XS,JSON::XS,JSON::PP,JSON::backportPP' 'Cpanel::JSON::XS,JSON::XS,JSON::PP,JSON::backportPP'
# unless ( defined( $ENV{PERL_JSON_BACKEND} ) ); unless ( defined( $ENV{PERL_JSON_BACKEND} ) );
# require JSON; require JSON;
# import JSON qw( decode_json encode_json ); import JSON qw( decode_json encode_json );
# 1; 1;
# } or do { } or do {
# In rare cases, Cpanel::JSON::XS may # In rare cases, Cpanel::JSON::XS may
# be installed but JSON|JSON::MaybeXS not ... # be installed but JSON|JSON::MaybeXS not ...
# eval { eval {
# require Cpanel::JSON::XS; require Cpanel::JSON::XS;
# import Cpanel::JSON::XS qw(decode_json encode_json); import Cpanel::JSON::XS qw(decode_json encode_json);
# 1; 1;
# } or do { } or do {
# In rare cases, JSON::XS may # In rare cases, JSON::XS may
# be installed but JSON not ... # be installed but JSON not ...
# eval { eval {
# require JSON::XS; require JSON::XS;
# import JSON::XS qw(decode_json encode_json); import JSON::XS qw(decode_json encode_json);
# 1; 1;
# } or do { } or do {
# Fallback to built-in JSON which SHOULD # Fallback to built-in JSON which SHOULD
# be available since 5.014 ... # be available since 5.014 ...
# eval { eval {
# require JSON::PP; require JSON::PP;
# import JSON::PP qw(decode_json encode_json); import JSON::PP qw(decode_json encode_json);
# 1; 1;
# } or do { } or do {
# Fallback to JSON::backportPP in really rare cases # Fallback to JSON::backportPP in really rare cases
# require JSON::backportPP; require JSON::backportPP;
# import JSON::backportPP qw(decode_json encode_json); import JSON::backportPP qw(decode_json encode_json);
# 1; 1;
# }; };
# }; };
# }; };
# }; };
#}; };
# Import von Funktionen und/oder Variablen aus der FHEM main # Import von Funktionen und/oder Variablen aus der FHEM main
# man kann ::Funktionaname wählen und sich so den Import schenken. Variablen sollten aber # man kann ::Funktionaname wählen und sich so den Import schenken. Variablen sollten aber