[TYPO3-core] contrib/json.php vs PHP json_encode

Thorsten Kahler thorsten.kahler at dkd.de
Wed Sep 5 10:07:22 CEST 2007


Martin Kutschker wrote on 05.09.2007 09:58:
> As we are trying to target 5.2 as possible (and will not support 5.0 
> anyway) I would try to add yet another wrapper in t3lib_div.
> 
> So I am for doing it like this in compat_php52.php:
> 
> if (!function_exists('json_encode')) {
> 
>   function json_encode($array) (
>    if (!$GLOBALS['JSON']) {
>      require_once(PATH_typo3.'contrib/json.php');
>      $GLOBALS['JSON'] = t3lib_div::makeInstance('Services_JSON');
>    }
>    return $GLOBALS['JSON']->encode($array);
>   }
> 
> }
> 
> In 4.3 we can remove this again.
> 

+1 if json_decode() is added there too

Regards
Thorsten

-- 

Thorsten Kahler
thorsten.kahler at dkd.de


More information about the TYPO3-team-core mailing list