]> granicus.if.org Git - php/commitdiff
update constructors so they cant be called statically
authorRob Richards <rrichards@php.net>
Thu, 22 Jan 2004 21:16:05 +0000 (21:16 +0000)
committerRob Richards <rrichards@php.net>
Thu, 22 Jan 2004 21:16:05 +0000 (21:16 +0000)
14 files changed:
ext/dom/attr.c
ext/dom/cdatasection.c
ext/dom/comment.c
ext/dom/document.c
ext/dom/documentfragment.c
ext/dom/element.c
ext/dom/entityreference.c
ext/dom/namednodemap.c
ext/dom/nodelist.c
ext/dom/php_dom.c
ext/dom/php_dom.h
ext/dom/processinginstruction.c
ext/dom/text.c
ext/dom/xpath.c

index 90615f8a58dfc079df5167b016798f75a664229c..c5bf81897a84c714ab5f0ca0e602ad7bf272ff83 100644 (file)
@@ -54,13 +54,12 @@ PHP_FUNCTION(dom_attr_attr)
        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;
index 5d6e2402a4469691228773c89b707af35ff94520..0daab0bfcc30ceb48db6ec8740ae42f506797c1d 100644 (file)
@@ -40,7 +40,7 @@ zend_function_entry php_dom_cdatasection_class_functions[] = {
        {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 @@ PHP_FUNCTION(dom_cdatasection_cdatasection)
        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)
index 15fceb4bdd659d569ab8949f127f70f98d2284f0..5963ff9e735ae63d0a6b31dd634a0c70a020a67e 100644 (file)
@@ -50,9 +50,7 @@ PHP_FUNCTION(dom_comment_comment)
        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;
        }
 
index 22e40e67522d0ae28fb99afa99bdff723236e1f8..a5f67e6c2a58eba0edbfd3abb81b6a526381f01b 100644 (file)
@@ -1092,10 +1092,8 @@ PHP_FUNCTION(dom_document_document)
        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;
        }
 
index a76922720a95d3771a91ef2f46350ac1e1527d73..a51c7af5a358c50663b7a6c1056c3f39b93e3983 100644 (file)
@@ -48,7 +48,9 @@ PHP_FUNCTION(dom_documentfragment_documentfragment)
        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);
 
index 68accf015c8850baade11e146a34a6f8776a530a..545e58a90cc3df0f3d3b314a589d364877ff7c09 100644 (file)
@@ -68,9 +68,7 @@ PHP_FUNCTION(dom_element_element)
        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;
        }
 
index 283ce7bd1a83bb3762917a03ad078aa3d2632c08..9d8039f57700208cc05305824c09b2dddbc6db0e 100644 (file)
@@ -50,9 +50,7 @@ PHP_FUNCTION(dom_entityreference_entityreference)
        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;
        }
 
index 68a51648c1865fef1b89f80a64278029270ece33..877845fbcfe17db47d0e5705af6cf7225541a32d 100644 (file)
@@ -103,9 +103,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
        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 @@ PHP_FUNCTION(dom_namednodemap_item)
        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 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
        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;
        }
 
index a15228b3761da8a218d0d016fa8a5642719eab33..22083228040ff20f066be4ec933672461593ccd1 100644 (file)
@@ -110,9 +110,7 @@ PHP_FUNCTION(dom_nodelist_item)
        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;
        }
 
index aee8c69e6259120a2d4efd14a1aafa4397e17998..770a89696f15f97646cbff4e4270a4ee60e17781 100644 (file)
@@ -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"
index d5e976e953e6602b9691365a6aac2bf6af033337..64ea2c9e647b9989d799e1f93955c0c9a4c5e06b 100644 (file)
@@ -57,6 +57,7 @@ extern zend_module_entry dom_module_entry;
 #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");
index 13e1f79e8248199004f401047cdc1c8fd1f07fbd..3a57457122a55440a2ce7ed901475efafe084851 100644 (file)
@@ -50,9 +50,7 @@ PHP_FUNCTION(dom_processinginstruction_processinginstruction)
        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;
        }
 
index b049c9cd87f1aed9722a0b59ae578392968ebf47..d315adaff86c70c35f0ec1565725114e3e3a8fdb 100644 (file)
@@ -53,9 +53,7 @@ PHP_FUNCTION(dom_text_text)
        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;
        }
 
index 28b118e50c544bd35aaf4fe76dc4dcb983cb183f..4b693bb4653535eaca7ca8730ed4b94cbdb4e42b 100644 (file)
@@ -49,9 +49,7 @@ PHP_FUNCTION(dom_xpath_xpath)
        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;
        }