mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
wddx serialization works now
This commit is contained in:
parent
92896a9945
commit
a597f24b5e
2 changed files with 25 additions and 5 deletions
|
@ -147,5 +147,12 @@ void session_adapt_uris(const char *, uint, char **, uint *);
|
|||
#else
|
||||
#define session_adapt_uris(a,b,c,d) do { } while(0)
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
#if HAVE_WDDX
|
||||
#define WDDX_SERIALIZER
|
||||
#include "ext/wddx/php_wddx_api.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -79,8 +79,14 @@ PHP_INI_BEGIN()
|
|||
PHP_INI_END()
|
||||
|
||||
PS_SERIALIZER_FUNCS(php);
|
||||
#ifdef WDDX_SERIALIZER
|
||||
PS_SERIALIZER_FUNCS(wddx);
|
||||
#endif
|
||||
|
||||
const static ps_serializer ps_serializers[] = {
|
||||
#ifdef WDDX_SERIALIZER
|
||||
PS_SERIALIZER_ENTRY(wddx),
|
||||
#endif
|
||||
PS_SERIALIZER_ENTRY(php),
|
||||
{0}
|
||||
};
|
||||
|
@ -201,17 +207,18 @@ PS_SERIALIZER_DECODE_FUNC(php)
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef WDDX_SERIALIZER
|
||||
|
||||
PS_SERIALIZER_ENCODE_FUNC(wddx)
|
||||
{
|
||||
wddx_packet *packet;
|
||||
char *key;
|
||||
ELS_FETCH();
|
||||
zval **struc;
|
||||
char *buf;
|
||||
ELS_FETCH();
|
||||
|
||||
packet = _php_wddx_constructor();
|
||||
if(!packet) return FAILURE;
|
||||
|
||||
_php_wddx_packet_start(packet, NULL);
|
||||
_php_wddx_add_chunk(packet, WDDX_STRUCT_S);
|
||||
|
@ -222,6 +229,7 @@ PS_SERIALIZER_ENCODE_FUNC(wddx)
|
|||
if(zend_hash_find(&EG(symbol_table), key, strlen(key) + 1, (void **) &struc) == SUCCESS) {
|
||||
_php_wddx_serialize_var(packet, *struc, key);
|
||||
}
|
||||
efree(key);
|
||||
}
|
||||
|
||||
_php_wddx_add_chunk(packet, WDDX_STRUCT_E);
|
||||
|
@ -244,7 +252,9 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
|
|||
int hash_type;
|
||||
ELS_FETCH();
|
||||
|
||||
retval = (zval *) ecalloc(sizeof(zval), 1);
|
||||
if(vallen == 0) return FAILURE;
|
||||
|
||||
MAKE_STD_ZVAL(retval);
|
||||
|
||||
_php_wddx_deserialize(val, retval);
|
||||
|
||||
|
@ -269,13 +279,16 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
|
|||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static char *_php_session_encode(int *newlen PSLS_DC)
|
||||
{
|
||||
char *ret = NULL;
|
||||
|
||||
PS(serializer)->encode(&ret, newlen PSLS_CC);
|
||||
if(PS(serializer)->encode(&ret, newlen PSLS_CC) == FAILURE) {
|
||||
ret = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue