summaryrefslogtreecommitdiff
path: root/ext/simplexml
diff options
context:
space:
mode:
Diffstat (limited to 'ext/simplexml')
-rw-r--r--ext/simplexml/config.m42
-rw-r--r--ext/simplexml/simplexml.c29
2 files changed, 12 insertions, 19 deletions
diff --git a/ext/simplexml/config.m4 b/ext/simplexml/config.m4
index 2145e23d88..387a24ea21 100644
--- a/ext/simplexml/config.m4
+++ b/ext/simplexml/config.m4
@@ -6,7 +6,7 @@ PHP_ARG_ENABLE(simplexml, whether to enable SimpleXML support,
if test -z "$PHP_LIBXML_DIR"; then
PHP_ARG_WITH(libxml-dir, libxml2 install dir,
- [ --with-libxml-dir=DIR SimpleXML: libxml2 install prefix], no, no)
+ [ --with-libxml-dir=DIR SimpleXML: libxml2 install prefix], no, no)
fi
if test "$PHP_SIMPLEXML" != "no"; then
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 16070fc92a..a915862ec4 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -59,7 +59,7 @@ static zval *sxe_get_value(zval *z TSRMLS_DC);
static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC);
static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC);
-static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC);
static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC);
static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC);
@@ -694,7 +694,7 @@ static void sxe_dimension_write(zval *object, zval *offset, zval *value TSRMLS_D
}
/* }}} */
-static zval** sxe_property_get_adr(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
+static zval** sxe_property_get_adr(zval *object, zval *member, int fetch_type, const zend_literal *key TSRMLS_DC) /* {{{ */
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -2382,29 +2382,22 @@ static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval ***da
}
/* }}} */
-static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
- zval *curobj;
- xmlNodePtr curnode = NULL;
- php_sxe_object *intern;
- int namelen;
-
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
- curobj = iterator->sxe->iter.data;
+ zval *curobj = iterator->sxe->iter.data;
+ php_sxe_object *intern = (php_sxe_object *)zend_object_store_get_object(curobj TSRMLS_CC);
- intern = (php_sxe_object *)zend_object_store_get_object(curobj TSRMLS_CC);
+ xmlNodePtr curnode = NULL;
if (intern != NULL && intern->node != NULL) {
curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node;
}
- if (!curnode) {
- return HASH_KEY_NON_EXISTANT;
- }
-
- namelen = xmlStrlen(curnode->name);
- *str_key = estrndup((char *)curnode->name, namelen);
- *str_key_len = namelen + 1;
- return HASH_KEY_IS_STRING;
+ if (curnode) {
+ ZVAL_STRINGL(key, (char *) curnode->name, xmlStrlen(curnode->name), 1);
+ } else {
+ ZVAL_NULL(key);
+ }
}
/* }}} */