mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
- Allow xpl/simplexml integration with simplexml being built shared
This commit is contained in:
parent
08b5c498ce
commit
69722777a0
@ -23,4 +23,5 @@ if test "$PHP_SIMPLEXML" != "no"; then
|
||||
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
|
||||
])
|
||||
PHP_ADD_EXTENSION_DEP(simplexml, libxml)
|
||||
PHP_ADD_EXTENSION_DEP(simplexml, spl, true)
|
||||
fi
|
||||
|
@ -146,13 +146,16 @@ static zend_function_entry spl_funcs_SimpleXMLIterator[] = {
|
||||
|
||||
SPL_API PHP_MINIT_FUNCTION(spl_sxe) /* {{{ */
|
||||
{
|
||||
zend_class_entry *spl_ce_SimpleXML_Element = sxe_get_element_class_entry();
|
||||
|
||||
if (!spl_ce_SimpleXML_Element) {
|
||||
zend_class_entry **pce, *spl_ce_SimpleXMLElement;
|
||||
|
||||
if (zend_hash_find(CG(class_table), "simplexmlelement", sizeof("SimpleXMLElement"), (void **) &pce) == FAILURE) {
|
||||
spl_ce_SimpleXMLIterator = NULL;
|
||||
return SUCCESS; /* SimpleXML must be initialized before */
|
||||
}
|
||||
|
||||
spl_ce_SimpleXMLElement = *pce;
|
||||
|
||||
REGISTER_SPL_SUB_CLASS_EX(SimpleXMLIterator, SimpleXML_Element, sxe_object_new, spl_funcs_SimpleXMLIterator);
|
||||
REGISTER_SPL_SUB_CLASS_EX(SimpleXMLIterator, SimpleXMLElement, sxe_object_new, spl_funcs_SimpleXMLIterator);
|
||||
REGISTER_SPL_IMPLEMENTS(SimpleXMLIterator, RecursiveIterator);
|
||||
|
||||
return SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user