helly Wed Oct 5 15:12:44 2005 EDT
Modified files:
/php-src/ext/simplexml simplexml.c
/php-src/ext/spl spl_directory.c spl_iterators.c
/php-src/ext/tidy tidy.c
Log:
- Update cast_object handlers
http://cvs.php.net/diff.php/php-src/ext/simplexml/simplexml.c?r1=1.161&r2=1.162&ty=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.161
php-src/ext/simplexml/simplexml.c:1.162
--- php-src/ext/simplexml/simplexml.c:1.161 Mon Oct 3 12:04:50 2005
+++ php-src/ext/simplexml/simplexml.c Wed Oct 5 15:12:42 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: simplexml.c,v 1.161 2005/10/03 16:04:50 helly Exp $ */
+/* $Id: simplexml.c,v 1.162 2005/10/05 19:12:42 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1040,20 +1040,15 @@
/* {{{ sxe_object_cast()
*/
static int
-sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free
TSRMLS_DC)
+sxe_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
{
php_sxe_object *sxe;
char *contents = NULL;
xmlNodePtr node;
- zval free_obj;
int rv;
sxe = php_sxe_fetch_object(readobj TSRMLS_CC);
- if (should_free) {
- free_obj = *writeobj;
- }
-
if (sxe->iter.type != SXE_ITER_NONE) {
node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC);
if (node) {
@@ -1078,9 +1073,6 @@
if (contents) {
xmlFree(contents);
}
- if (should_free) {
- zval_dtor(&free_obj);
- }
return rv;
}
/* }}} */
@@ -1765,7 +1757,7 @@
{
php_info_print_table_start();
php_info_print_table_header(2, "Simplexml support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.161 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.162 $");
php_info_print_table_row(2, "Schema support",
#ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
http://cvs.php.net/diff.php/php-src/ext/spl/spl_directory.c?r1=1.48&r2=1.49&ty=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.48
php-src/ext/spl/spl_directory.c:1.49
--- php-src/ext/spl/spl_directory.c:1.48 Thu Sep 15 10:07:38 2005
+++ php-src/ext/spl/spl_directory.c Wed Oct 5 15:12:43 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.c,v 1.48 2005/09/15 14:07:38 helly Exp $ */
+/* $Id: spl_directory.c,v 1.49 2005/10/05 19:12:43 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -793,19 +793,12 @@
/* }}} */
/* {{{ spl_ce_dir_cast */
-static int spl_ce_dir_cast(zval *readobj, zval *writeobj, int type, int
should_free TSRMLS_DC)
+static int spl_ce_dir_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
{
- zval free_obj;
spl_ce_dir_object *dir_object =
(spl_ce_dir_object*)zend_object_store_get_object(readobj TSRMLS_CC);
if (type ==IS_STRING && *dir_object->entry.d_name) {
- if (should_free) {
- free_obj = *writeobj;
- }
ZVAL_STRING(writeobj, dir_object->entry.d_name, 1);
- if (should_free) {
- zval_dtor(&free_obj);
- }
return SUCCESS;
}
return FAILURE;
http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.87&r2=1.88&ty=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.87
php-src/ext/spl/spl_iterators.c:1.88
--- php-src/ext/spl/spl_iterators.c:1.87 Mon Oct 3 06:08:56 2005
+++ php-src/ext/spl/spl_iterators.c Wed Oct 5 15:12:43 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.87 2005/10/03 10:08:56 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.88 2005/10/05 19:12:43 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -1522,46 +1522,19 @@
zval_ptr_dtor(&retval);
}
if (intern->u.caching.flags & CIT_CALL_TOSTRING) {
- if (Z_TYPE_P(intern->current.data) == IS_OBJECT) {
- zval expr_copy;
- if
(intern->current.data->value.obj.handlers->cast_object &&
-
intern->current.data->value.obj.handlers->cast_object(intern->current.data,
&expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS)
- {
- ALLOC_ZVAL(intern->u.caching.zstr);
- *intern->u.caching.zstr = expr_copy;
- INIT_PZVAL(intern->u.caching.zstr);
- zval_copy_ctor(intern->u.caching.zstr);
- zval_dtor(&expr_copy);
- } else {
- zend_class_entry *ce_data =
spl_get_class_entry(intern->current.data TSRMLS_CC);
- if (ce_data &&
zend_hash_exists(&ce_data->function_table, "__tostring", sizeof("__tostring")))
{
-
zend_call_method_with_0_params(&intern->current.data, ce_data, NULL,
"__tostring", &intern->u.caching.zstr);
- } else {
-
ALLOC_ZVAL(intern->u.caching.zstr);
- *intern->u.caching.zstr =
*intern->current.data;
-
zval_copy_ctor(intern->u.caching.zstr);
-
INIT_PZVAL(intern->u.caching.zstr);
-
convert_to_string(intern->u.caching.zstr);
- }
- }
+ int use_copy;
+ zval expr_copy;
+ ALLOC_ZVAL(intern->u.caching.zstr);
+ *intern->u.caching.zstr = *intern->current.data;
+ zend_make_printable_zval(intern->u.caching.zstr,
&expr_copy, &use_copy);
+ if (use_copy) {
+ *intern->u.caching.zstr = expr_copy;
+ INIT_PZVAL(intern->u.caching.zstr);
+ zval_copy_ctor(intern->u.caching.zstr);
+ zval_dtor(&expr_copy);
} else {
- /* This version requires
zend_make_printable_zval() being able to
- * call __toString().
- */
- int use_copy;
- zval expr_copy;
- ALLOC_ZVAL(intern->u.caching.zstr);
- *intern->u.caching.zstr = *intern->current.data;
-
zend_make_printable_zval(intern->u.caching.zstr, &expr_copy, &use_copy);
- if (use_copy) {
- *intern->u.caching.zstr = expr_copy;
- INIT_PZVAL(intern->u.caching.zstr);
- zval_copy_ctor(intern->u.caching.zstr);
- zval_dtor(&expr_copy);
- } else {
- INIT_PZVAL(intern->u.caching.zstr);
- zval_copy_ctor(intern->u.caching.zstr);
- }
+ INIT_PZVAL(intern->u.caching.zstr);
+ zval_copy_ctor(intern->u.caching.zstr);
}
}
spl_dual_it_next(intern, 0 TSRMLS_CC);
http://cvs.php.net/diff.php/php-src/ext/tidy/tidy.c?r1=1.67&r2=1.68&ty=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.67 php-src/ext/tidy/tidy.c:1.68
--- php-src/ext/tidy/tidy.c:1.67 Fri Aug 12 10:08:28 2005
+++ php-src/ext/tidy/tidy.c Wed Oct 5 15:12:44 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tidy.c,v 1.67 2005/08/12 14:08:28 sebastian Exp $ */
+/* $Id: tidy.c,v 1.68 2005/10/05 19:12:44 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -206,8 +206,8 @@
static zend_class_entry *tidy_get_ce_node(zval * TSRMLS_DC);
static zend_class_entry *tidy_get_ce_doc(zval * TSRMLS_DC);
static zval * tidy_instanciate(zend_class_entry *, zval * TSRMLS_DC);
-static int tidy_doc_cast_handler(zval *, zval *, int, int TSRMLS_DC);
-static int tidy_node_cast_handler(zval *, zval *, int, int TSRMLS_DC);
+static int tidy_doc_cast_handler(zval *, zval *, int TSRMLS_DC);
+static int tidy_node_cast_handler(zval *, zval *, int TSRMLS_DC);
static void tidy_doc_update_properties(PHPTidyObj * TSRMLS_DC);
static void tidy_add_default_properties(PHPTidyObj *, tidy_obj_type TSRMLS_DC);
static void *php_tidy_get_opt_val(PHPTidyDoc *, TidyOption, TidyOptionType *
TSRMLS_DC);
@@ -626,7 +626,7 @@
return object;
}
-static int tidy_doc_cast_handler(zval *in, zval *out, int type, int free
TSRMLS_DC)
+static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
{
TidyBuffer output = {0};
PHPTidyObj *obj;
@@ -658,7 +658,7 @@
return SUCCESS;
}
-static int tidy_node_cast_handler(zval *in, zval *out, int type, int free
TSRMLS_DC)
+static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
{
TidyBuffer buf = {0};
PHPTidyObj *obj;
@@ -962,7 +962,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char
*)tidyReleaseDate());
- php_info_print_table_row(2, "Extension Version",
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.67 2005/08/12 14:08:28 sebastian Exp
$)");
+ php_info_print_table_row(2, "Extension Version",
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.68 2005/10/05 19:12:44 helly Exp
$)");
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php