ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilJsonUtil Class Reference

JSON (Javascript Object Notation) functions with backward compatibility for PHP version < 5.2. More...

+ Collaboration diagram for ilJsonUtil:

Static Public Member Functions

static encode ($mixed, $suppress_native=false)
static decode ($json_notated_string, $suppress_native=false)
static checkNativeSupport ()

Detailed Description

JSON (Javascript Object Notation) functions with backward compatibility for PHP version < 5.2.

Author
Jan Posselt jposs.nosp@m.elt@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilJsonUtil.php.

Member Function Documentation

static ilJsonUtil::checkNativeSupport ( )
static

Definition at line 42 of file class.ilJsonUtil.php.

{
return function_exists('json_encode') && function_exists('json_decode');
}
static ilJsonUtil::decode (   $json_notated_string,
  $suppress_native = false 
)
static

Definition at line 28 of file class.ilJsonUtil.php.

References SERVICES_JSON_SUPPRESS_ERRORS.

{
if (!$suppress_native && self::checkNativeSupport())
{
return json_decode($json_notated_string);
}
else
{
include_once './Services/JSON/include/json.php';
return $json->decode($json_notated_string);
}
}

The documentation for this class was generated from the following file: