summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_webdata_transfer.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2014-10-28 22:15:05 +0100
committerBob Weinand <bobwei9@hotmail.com>2014-10-28 22:15:05 +0100
commit6150d9342c877192af3b3ba5da677accdfa69259 (patch)
tree2be6f15e26d119e6928e0321ed3db04646d9b707 /sapi/phpdbg/phpdbg_webdata_transfer.c
parent9028846c6315903a4d43f436aced67ca1d345e69 (diff)
parentd25cc7f09085ea8f162a984b8345c6ecaebf0a65 (diff)
downloadphp-git-6150d9342c877192af3b3ba5da677accdfa69259.tar.gz
Merge ../phpdbg into PHP-5.6
Conflicts: sapi/phpdbg/config.m4
Diffstat (limited to 'sapi/phpdbg/phpdbg_webdata_transfer.c')
-rw-r--r--sapi/phpdbg/phpdbg_webdata_transfer.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.c b/sapi/phpdbg/phpdbg_webdata_transfer.c
index e7438ea01a..1cbc4107b5 100644
--- a/sapi/phpdbg/phpdbg_webdata_transfer.c
+++ b/sapi/phpdbg/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
}