diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2014-10-28 22:15:05 +0100 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2014-10-28 22:15:05 +0100 |
commit | 4bc7a91be71f833672cc52134e665ce0b08bd61c (patch) | |
tree | 2ca6ac0174e34b3377716f0f87fc024c21d7193e /phpdbg_webdata_transfer.c | |
parent | 36fef6dcd9d9e95127726fcfb231303ca59749b9 (diff) | |
download | php-git-4bc7a91be71f833672cc52134e665ce0b08bd61c.tar.gz |
Merge ../phpdbg into PHP-5.6
Conflicts:
sapi/phpdbg/config.m4
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 } |