mirror of
https://github.com/e107inc/e107.git
synced 2025-07-24 00:12:24 +02:00
php_compatibility_handler - JSON support added
This commit is contained in:
@@ -15,23 +15,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//PHP < 5.2 compatibility
|
|
||||||
if (!function_exists('json_encode'))
|
|
||||||
{
|
|
||||||
require_once(e_HANDLER.'json_compat_handler.php');
|
|
||||||
function json_encode($array)
|
|
||||||
{
|
|
||||||
$json = new Services_JSON();
|
|
||||||
return $json->encode($array);
|
|
||||||
}
|
|
||||||
|
|
||||||
function json_decode($json_obj)
|
|
||||||
{
|
|
||||||
$json = new Services_JSON();
|
|
||||||
return $json->decode($json_obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class e_jshelper
|
class e_jshelper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@@ -264,3 +264,20 @@ if (!function_exists('strptime'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//PHP < 5.2 compatibility
|
||||||
|
if (!function_exists('json_encode'))
|
||||||
|
{
|
||||||
|
require_once(e_HANDLER.'json_compat_handler.php');
|
||||||
|
function json_encode($array)
|
||||||
|
{
|
||||||
|
$json = new Services_JSON();
|
||||||
|
return $json->encode($array);
|
||||||
|
}
|
||||||
|
|
||||||
|
function json_decode($json_obj)
|
||||||
|
{
|
||||||
|
$json = new Services_JSON();
|
||||||
|
return $json->decode($json_obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user