diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2014-10-28 22:14:35 +0100 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2014-10-28 22:14:35 +0100 |
| commit | d25cc7f09085ea8f162a984b8345c6ecaebf0a65 (patch) | |
| tree | 2ca6ac0174e34b3377716f0f87fc024c21d7193e /phpdbg_webdata_transfer.c | |
| parent | 69b999eb7ed802f488f674f8d4294e09e6d46610 (diff) | |
| download | php-git-d25cc7f09085ea8f162a984b8345c6ecaebf0a65.tar.gz | |
Use serialize instead of json for transfer
Diffstat (limited to 'phpdbg_webdata_transfer.c')
| -rw-r--r-- | phpdbg_webdata_transfer.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/phpdbg_webdata_transfer.c b/phpdbg_webdata_transfer.c index e7438ea01a..1cbc4107b5 100644 --- a/phpdbg_webdata_transfer.c +++ b/phpdbg_webdata_transfer.c @@ -17,11 +17,9 @@ */ #include "phpdbg_webdata_transfer.h" -#include "ext/json/php_json.h" +#include "ext/standard/php_var.h" PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) { -#ifdef HAVE_JSON - smart_str buf = {0}; zval array; HashTable *ht; /* I really need to change that to an array of zvals... */ @@ -177,9 +175,17 @@ PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) { } /* encode data */ - php_json_encode(&buf, &array, 0 TSRMLS_CC); - *msg = buf.c; - *len = buf.len; + { + php_serialize_data_t var_hash; + smart_str buf = {0}; + zval *arrayptr = &array; + + PHP_VAR_SERIALIZE_INIT(var_hash); + php_var_serialize(&buf, &arrayptr, &var_hash TSRMLS_CC); + PHP_VAR_SERIALIZE_DESTROY(var_hash); + *msg = buf.c; + *len = buf.len; + } + zval_dtor(&array); -#endif } |
