rrichards Thu Jan 22 16:16:06 2004 EDT Modified files: /php-src/ext/dom attr.c cdatasection.c comment.c document.c documentfragment.c element.c entityreference.c namednodemap.c nodelist.c php_dom.c php_dom.h processinginstruction.c text.c xpath.c Log: update constructors so they cant be called statically
http://cvs.php.net/diff.php/php-src/ext/dom/attr.c?r1=1.9&r2=1.10&ty=u Index: php-src/ext/dom/attr.c diff -u php-src/ext/dom/attr.c:1.9 php-src/ext/dom/attr.c:1.10 --- php-src/ext/dom/attr.c:1.9 Thu Jan 8 03:15:16 2004 +++ php-src/ext/dom/attr.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: attr.c,v 1.9 2004/01/08 08:15:16 andi Exp $ */ +/* $Id: attr.c,v 1.10 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -54,13 +54,12 @@ char *name, *value = NULL; int name_len, value_len; - id = getThis(); - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &name, &name_len, &value, &value_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { return; } + intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); + if (name_len == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute name is required"); RETURN_FALSE; http://cvs.php.net/diff.php/php-src/ext/dom/cdatasection.c?r1=1.6&r2=1.7&ty=u Index: php-src/ext/dom/cdatasection.c diff -u php-src/ext/dom/cdatasection.c:1.6 php-src/ext/dom/cdatasection.c:1.7 --- php-src/ext/dom/cdatasection.c:1.6 Thu Jan 8 03:15:16 2004 +++ php-src/ext/dom/cdatasection.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cdatasection.c,v 1.6 2004/01/08 08:15:16 andi Exp $ */ +/* $Id: cdatasection.c,v 1.7 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -40,7 +40,7 @@ {NULL, NULL, NULL} }; -/* {{{ proto domnode dom_cdatasection_cdatasection([string value]); */ +/* {{{ proto domnode dom_cdatasection_cdatasection(string value); */ PHP_FUNCTION(dom_cdatasection_cdatasection) { @@ -50,13 +50,10 @@ char *value = NULL; int value_len; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) { return; } - nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len); if (!nodep) http://cvs.php.net/diff.php/php-src/ext/dom/comment.c?r1=1.6&r2=1.7&ty=u Index: php-src/ext/dom/comment.c diff -u php-src/ext/dom/comment.c:1.6 php-src/ext/dom/comment.c:1.7 --- php-src/ext/dom/comment.c:1.6 Thu Jan 8 03:15:16 2004 +++ php-src/ext/dom/comment.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: comment.c,v 1.6 2004/01/08 08:15:16 andi Exp $ */ +/* $Id: comment.c,v 1.7 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -50,9 +50,7 @@ char *value = NULL; int value_len; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &value, &value_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) { return; } http://cvs.php.net/diff.php/php-src/ext/dom/document.c?r1=1.46&r2=1.47&ty=u Index: php-src/ext/dom/document.c diff -u php-src/ext/dom/document.c:1.46 php-src/ext/dom/document.c:1.47 --- php-src/ext/dom/document.c:1.46 Tue Jan 20 06:35:32 2004 +++ php-src/ext/dom/document.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: document.c,v 1.46 2004/01/20 11:35:32 rrichards Exp $ */ +/* $Id: document.c,v 1.47 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1092,10 +1092,8 @@ dom_object *intern; char *encoding, *version = NULL; int encoding_len = 0, version_len = 0, refcount; - - id = getThis(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &version, &version_len, &encoding, &encoding_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) { return; } http://cvs.php.net/diff.php/php-src/ext/dom/documentfragment.c?r1=1.6&r2=1.7&ty=u Index: php-src/ext/dom/documentfragment.c diff -u php-src/ext/dom/documentfragment.c:1.6 php-src/ext/dom/documentfragment.c:1.7 --- php-src/ext/dom/documentfragment.c:1.6 Thu Jan 8 03:15:16 2004 +++ php-src/ext/dom/documentfragment.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: documentfragment.c,v 1.6 2004/01/08 08:15:16 andi Exp $ */ +/* $Id: documentfragment.c,v 1.7 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -48,7 +48,9 @@ xmlNodePtr nodep = NULL, oldnode = NULL; dom_object *intern; - id = getThis(); + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) { + return; + } nodep = xmlNewDocFragment(NULL); http://cvs.php.net/diff.php/php-src/ext/dom/element.c?r1=1.22&r2=1.23&ty=u Index: php-src/ext/dom/element.c diff -u php-src/ext/dom/element.c:1.22 php-src/ext/dom/element.c:1.23 --- php-src/ext/dom/element.c:1.22 Thu Jan 8 03:15:16 2004 +++ php-src/ext/dom/element.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: element.c,v 1.22 2004/01/08 08:15:16 andi Exp $ */ +/* $Id: element.c,v 1.23 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -68,9 +68,7 @@ char *name, *value = NULL; int name_len, value_len = 0; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &name, &name_len, &value, &value_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { return; } http://cvs.php.net/diff.php/php-src/ext/dom/entityreference.c?r1=1.6&r2=1.7&ty=u Index: php-src/ext/dom/entityreference.c diff -u php-src/ext/dom/entityreference.c:1.6 php-src/ext/dom/entityreference.c:1.7 --- php-src/ext/dom/entityreference.c:1.6 Thu Jan 8 03:15:16 2004 +++ php-src/ext/dom/entityreference.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: entityreference.c,v 1.6 2004/01/08 08:15:16 andi Exp $ */ +/* $Id: entityreference.c,v 1.7 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -50,9 +50,7 @@ char *name; int name_len; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) { return; } http://cvs.php.net/diff.php/php-src/ext/dom/namednodemap.c?r1=1.7&r2=1.8&ty=u Index: php-src/ext/dom/namednodemap.c diff -u php-src/ext/dom/namednodemap.c:1.7 php-src/ext/dom/namednodemap.c:1.8 --- php-src/ext/dom/namednodemap.c:1.7 Thu Jan 8 03:15:16 2004 +++ php-src/ext/dom/namednodemap.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: namednodemap.c,v 1.7 2004/01/08 08:15:16 andi Exp $ */ +/* $Id: namednodemap.c,v 1.8 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -103,9 +103,7 @@ xmlNodePtr nodep; xmlNotation *notep = NULL; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &named, &namedlen) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_namednodemap_class_entry, &named, &namedlen) == FAILURE) { return; } @@ -172,9 +170,7 @@ xmlNodePtr nodep, curnode; int count; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_namednodemap_class_entry, &index) == FAILURE) { return; } @@ -229,9 +225,7 @@ xmlNodePtr nodep; xmlNotation *notep = NULL; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &uri, &urilen, &named, &namedlen) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_namednodemap_class_entry, &uri, &urilen, &named, &namedlen) == FAILURE) { return; } http://cvs.php.net/diff.php/php-src/ext/dom/nodelist.c?r1=1.9&r2=1.10&ty=u Index: php-src/ext/dom/nodelist.c diff -u php-src/ext/dom/nodelist.c:1.9 php-src/ext/dom/nodelist.c:1.10 --- php-src/ext/dom/nodelist.c:1.9 Sat Jan 10 06:50:25 2004 +++ php-src/ext/dom/nodelist.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: nodelist.c,v 1.9 2004/01/10 11:50:25 rrichards Exp $ */ +/* $Id: nodelist.c,v 1.10 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -110,9 +110,7 @@ HashTable *nodeht; pval **entry; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_nodelist_class_entry, &index) == FAILURE) { return; } http://cvs.php.net/diff.php/php-src/ext/dom/php_dom.c?r1=1.48&r2=1.49&ty=u Index: php-src/ext/dom/php_dom.c diff -u php-src/ext/dom/php_dom.c:1.48 php-src/ext/dom/php_dom.c:1.49 --- php-src/ext/dom/php_dom.c:1.48 Tue Jan 13 09:13:21 2004 +++ php-src/ext/dom/php_dom.c Thu Jan 22 16:16:05 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dom.c,v 1.48 2004/01/13 14:13:21 rrichards Exp $ */ +/* $Id: php_dom.c,v 1.49 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -28,7 +28,6 @@ #if HAVE_LIBXML && HAVE_DOM #include "ext/standard/php_rand.h" #include "php_dom.h" -#include "dom_ce.h" #include "dom_properties.h" #include "ext/standard/info.h" http://cvs.php.net/diff.php/php-src/ext/dom/php_dom.h?r1=1.22&r2=1.23&ty=u Index: php-src/ext/dom/php_dom.h diff -u php-src/ext/dom/php_dom.h:1.22 php-src/ext/dom/php_dom.h:1.23 --- php-src/ext/dom/php_dom.h:1.22 Sat Jan 10 06:50:25 2004 +++ php-src/ext/dom/php_dom.h Thu Jan 22 16:16:05 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dom.h,v 1.22 2004/01/10 11:50:25 rrichards Exp $ */ +/* $Id: php_dom.h,v 1.23 2004/01/22 21:16:05 rrichards Exp $ */ #ifndef PHP_DOM_H #define PHP_DOM_H @@ -57,6 +57,7 @@ #include "xml_common.h" #include "ext/libxml/php_libxml.h" #include "zend_default_classes.h" +#include "dom_ce.h" /* DOM API_VERSION, please bump it up, if you change anything in the API therefore it's easier for the script-programmers to check, what's working how Can be checked with phpversion("dom"); http://cvs.php.net/diff.php/php-src/ext/dom/processinginstruction.c?r1=1.7&r2=1.8&ty=u Index: php-src/ext/dom/processinginstruction.c diff -u php-src/ext/dom/processinginstruction.c:1.7 php-src/ext/dom/processinginstruction.c:1.8 --- php-src/ext/dom/processinginstruction.c:1.7 Thu Jan 8 03:15:17 2004 +++ php-src/ext/dom/processinginstruction.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: processinginstruction.c,v 1.7 2004/01/08 08:15:17 andi Exp $ */ +/* $Id: processinginstruction.c,v 1.8 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -50,9 +50,7 @@ char *name, *value = NULL; int name_len, value_len; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &name, &name_len, &value, &value_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { return; } http://cvs.php.net/diff.php/php-src/ext/dom/text.c?r1=1.14&r2=1.15&ty=u Index: php-src/ext/dom/text.c diff -u php-src/ext/dom/text.c:1.14 php-src/ext/dom/text.c:1.15 --- php-src/ext/dom/text.c:1.14 Thu Jan 8 03:15:17 2004 +++ php-src/ext/dom/text.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: text.c,v 1.14 2004/01/08 08:15:17 andi Exp $ */ +/* $Id: text.c,v 1.15 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -53,9 +53,7 @@ char *value = NULL; int value_len; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &value, &value_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) { return; } http://cvs.php.net/diff.php/php-src/ext/dom/xpath.c?r1=1.14&r2=1.15&ty=u Index: php-src/ext/dom/xpath.c diff -u php-src/ext/dom/xpath.c:1.14 php-src/ext/dom/xpath.c:1.15 --- php-src/ext/dom/xpath.c:1.14 Tue Jan 20 06:35:32 2004 +++ php-src/ext/dom/xpath.c Thu Jan 22 16:16:05 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xpath.c,v 1.14 2004/01/20 11:35:32 rrichards Exp $ */ +/* $Id: xpath.c,v 1.15 2004/01/22 21:16:05 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -49,9 +49,7 @@ dom_object *docobj, *intern; xmlXPathContextPtr ctx, oldctx; - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &doc) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo", &id, dom_xpath_class_entry, &doc) == FAILURE) { return; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php