diff options
author | Georg Richter <georg@php.net> | 2004-06-23 16:47:25 +0000 |
---|---|---|
committer | Georg Richter <georg@php.net> | 2004-06-23 16:47:25 +0000 |
commit | f063bdec06c058822d36026e91e55f768d991dec (patch) | |
tree | ce8099280867d7a68b4a64cfba558f165c6df04c /ext/mysqli/mysqli.c | |
parent | dc701bfdabc8b800fde0eb29e51dd1fea09b5767 (diff) | |
download | php-git-f063bdec06c058822d36026e91e55f768d991dec.tar.gz |
added php_mysqli_construct_get to support __construct in extended classes
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r-- | ext/mysqli/mysqli.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index e149f8af67..c2f72b5d90 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -269,6 +269,27 @@ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli } /* }}} */ +static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC) +{ + mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); + + if (obj->zo.ce != mysqli_link_class_entry) { + return obj->zo.ce->constructor; + } else { + static zend_internal_function f; + + f.function_name = mysqli_link_class_entry->name; + f.scope = mysqli_link_class_entry; + f.arg_info = NULL; + f.num_args = 0; + f.fn_flags = 0; + + f.type = ZEND_INTERNAL_FUNCTION; + f.handler = ZEND_FN(mysqli_connect); + + return (union _zend_function*)&f; + } +} /* {{{ mysqli_objects_new */ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_type TSRMLS_DC) @@ -374,6 +395,7 @@ PHP_MINIT_FUNCTION(mysqli) mysqli_object_handlers.read_property = mysqli_read_property; mysqli_object_handlers.write_property = mysqli_write_property; mysqli_object_handlers.get_property_ptr_ptr = NULL; + mysqli_object_handlers.get_constructor = php_mysqli_constructor_get; zend_hash_init(&classes, 0, NULL, NULL, 1); |