@@ -177,6 +177,7 @@ PHP_FUNCTION(xml_parse_into_struct);
177
177
static zend_object * xml_parser_create_object (zend_class_entry * class_type );
178
178
static void xml_parser_free_obj (zend_object * object );
179
179
static HashTable * xml_parser_get_gc (zval * object , zval * * table , int * n );
180
+ static zend_function * xml_parser_get_constructor (zend_object * object );
180
181
181
182
static zend_string * xml_utf8_decode (const XML_Char * , size_t , const XML_Char * );
182
183
static void xml_set_handler (zval * , zval * );
@@ -408,7 +409,6 @@ static void php_xml_free_wrapper(void *ptr)
408
409
}
409
410
410
411
static const zend_function_entry xml_parser_methods [] = {
411
- // TODO
412
412
PHP_FE_END
413
413
};
414
414
@@ -424,6 +424,7 @@ PHP_MINIT_FUNCTION(xml)
424
424
xml_parser_object_handlers .offset = XtOffsetOf (xml_parser , std );
425
425
xml_parser_object_handlers .free_obj = xml_parser_free_obj ;
426
426
xml_parser_object_handlers .get_gc = xml_parser_get_gc ;
427
+ xml_parser_object_handlers .get_constructor = xml_parser_get_constructor ;
427
428
428
429
REGISTER_LONG_CONSTANT ("XML_ERROR_NONE" , XML_ERROR_NONE , CONST_CS |CONST_PERSISTENT );
429
430
REGISTER_LONG_CONSTANT ("XML_ERROR_NO_MEMORY" , XML_ERROR_NO_MEMORY , CONST_CS |CONST_PERSISTENT );
@@ -579,6 +580,11 @@ static HashTable *xml_parser_get_gc(zval *object, zval **table, int *n)
579
580
return zend_std_get_properties (object );
580
581
}
581
582
583
+ static zend_function * xml_parser_get_constructor (zend_object * object ) {
584
+ zend_throw_error (NULL , "Cannot directly construct XmlParser, use xml_parser_create() or xml_parser_create_ns() instead" );
585
+ return NULL ;
586
+ }
587
+
582
588
/* {{{ xml_set_handler() */
583
589
static void xml_set_handler (zval * handler , zval * data )
584
590
{
@@ -1577,7 +1583,6 @@ PHP_FUNCTION(xml_parser_free)
1577
1583
RETURN_FALSE ;
1578
1584
}
1579
1585
1580
- // TODO ???
1581
1586
RETURN_TRUE ;
1582
1587
}
1583
1588
/* }}} */
0 commit comments