1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-23 07:52:07 +02:00

php_compatibility_handler - JSON support added

This commit is contained in:
secretr
2010-12-10 14:20:15 +00:00
parent 976aaadcac
commit 83f716ec3e
2 changed files with 17 additions and 17 deletions

View File

@@ -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
{
/**

View File

@@ -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);
}
}