public static function decode($str, $assoc = false)
    {
        if (!function_exists('json_decode')) {
            $j = self::getJsonService();
            return $j->decode($str);
        }
        else {
            return $assoc ? json_decode($str, true) : json_decode($str);
        }
    }