HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/iranga.kauko.lt/wp-content/plugins/loco-translate/src/compat/JsonExtension.php
<?php
/**
 * Placeholder for missing PHP "json" extension.
 * Just avoids fatal errors. Does not actually replace functionality.
 *
 * If this extension is missing no JavaScript will work in the plugin at all.
 */
abstract class Loco_compat_JsonExtension {
    
    public static function json_encode( $value ){
        return '{"error":{"code":-1,"message":"json extension is not installed"}}';
    }

    public static function json_decode( $json ){
        return null;
    }
    
}


// @codeCoverageIgnoreStart

if( ! function_exists('json_encode') ){
    function json_encode( $value ){
        return Loco_compat_JsonExtension::json_encode( $value );
    }
}

if( ! function_exists('json_decode') ){
    function json_decode( $json ){
        return Loco_compat_JsonExtension::json_decode($json);
    }
}