Hello Blake,

fixed.

Thursday, January 8, 2004, 9:14:07 PM, you wrote:

> Hello Marcus,

> Okay.  I tracked it down.  I am using the new build system so that spl
> gets compiled in.  However, the problem is that simplexml is getting
> initialized before spl and simplexml needs the interface for spl to be
> initialized first.

> I found that the order of module initialization is stored in
> main/internal_functions.c.  Here is mine:

> zend_module_entry *php_builtin_extensions[] = {
>       phpext_bcmath_ptr,
>       phpext_calendar_ptr,
>       phpext_com_dotnet_ptr,
>       phpext_ctype_ptr,
>       phpext_dom_ptr,
>       phpext_ftp_ptr,
>       phpext_iconv_ptr,
>       phpext_libxml_ptr,
>       phpext_odbc_ptr,
>       phpext_pcre_ptr,
>       phpext_session_ptr,
>       phpext_simplexml_ptr,
>       phpext_spl_ptr,
>       phpext_sqlite_ptr,
>       phpext_standard_ptr,
>       phpext_tokenizer_ptr,
>       phpext_wddx_ptr,
>       phpext_xml_ptr,
>       phpext_zlib_ptr,
> };

> This file is created by the configure.js script.  If I manually edit the
> file to put the spl extension _before_ the simplexml then recompile
> everything works fine.

> It appears that configure is sorting the extension list alphabetically
> before generating the above entries.  I don't know if this is also the
> case on Linux (or other unixish).  If the entries were not alphabetical,
> but based on the order passed to the configure.js, then the builder
> could simply change the order on the configuration command line.

> This makes me wonder if there are other new order dependencies now that
> interfaces are a part of PHP.

> Blake Schwendiman

> -----Original Message-----
> From: Marcus Boerger [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, January 08, 2004 12:42 PM
> To: Blake Schwendiman
> Subject: Re: [PHP-DEV] SimpleXML and Default Cast To String

> Hello Blake,

> are you compiling with the new or the old build system?
> I used the new one. And there spl was compiled into the
> exe. So that's what you need to do and i obviously need
> to disallow relying on spl in sxe when spl is compiled
> shared -> done.

> Thursday, January 8, 2004, 7:56:17 PM, you wrote:

>> My build fails on this line (from simplexml.c):

>> zend_class_implements(sxe_class_entry TSRMLS_CC, 1,
>> spl_ce_RecursiveIterator);

>> At the time of the call, spl_ce_RecursiveIterator is NULL.  

>> I have to leave for about an hour.  Then I'll be back to do more
>> investigation.  I thought you'd like to know what I've found so far.

>> This failure occurs when simply trying to run the php.exe program at
>> all.  The call stack is:

>> php5ts_debug.dll!_zend_is_inconsistent(_hashtable * ht=0x000000a4,
> char
>> * file=0x1050f914, int line=773)  Line 53 + 0x3      

>> php5ts_debug.dll!_zend_hash_merge(_hashtable * target=0x00aee6ac,
>> _hashtable * source=0x000000a4, void (void *)*
>> pCopyConstructor=0x101acdc9, void * tmp=0x00000000, unsigned int
> size=4,
>> int overwrite=0, char * __zend_filename=0x1050d798, unsigned int
>> __zend_lineno=1919)  Line 773 + 0x17 

>> php5ts_debug.dll!zend_do_implement_interface(_zend_class_entry *
>> ce=0x00aee608, _zend_class_entry * iface=0x00000000, void * * *
>> tsrm_ls=0x00932fe0)  Line 1919 + 0x32        

>> php5ts_debug.dll!zend_class_implements(_zend_class_entry *
>> class_entry=0x00aee608, void * * * tsrm_ls=0x00932fe0, int
>> num_interfaces=0, ...)  Line 1490 + 0x11     

>> php5ts_debug.dll!zm_startup_simplexml(int type=1, int
> module_number=12,
>> void * * * tsrm_ls=0x00932fe0)  Line 1658 + 0x18     

>> php5ts_debug.dll!zend_startup_module(_zend_module_entry *
>> module=0x1067c520)  Line 1179 + 0x15 

>> php5ts_debug.dll!php_startup_extensions(_zend_module_entry * *
>> ptr=0x106723dc, int count=19)  Line 1294 + 0xb       

>> php5ts_debug.dll!php_startup_internal_extensions()  Line 80 + 0xc    

>> php5ts_debug.dll!php_module_startup(_sapi_module_struct *
> sf=0x0041a420,
>> _zend_module_entry * additional_modules=0x00000000, unsigned int
>> num_additional_modules=0)  Line 1460 + 0x5   

>> php.exe!main(int argc=2, char * * argv=0x00932c48)  Line 593 + 0x11  
>> php.exe!mainCRTStartup()  Line 400 + 0x11    

>> Blake Schwendiman

>> -----Original Message-----
>> From: Marcus Boerger [mailto:[EMAIL PROTECTED] 
>> Sent: Thursday, January 08, 2004 11:12 AM
>> To: Blake Schwendiman
>> Subject: Re: [PHP-DEV] SimpleXML and Default Cast To String

>> Hello Blake,

>> Thursday, January 8, 2004, 6:49:09 PM, you wrote:

>>> Hello Marcus,

>>> As far as you know, does SPL work on Windows?  I tried to install and
>>> build it (which worked fine), but my CLI build of PHP doesn't run
>>> anymore.

>>> I'll be looking at this some more; just wondering if you know of
>>> problems with SPL and Windows.

>>> Blake

>>> -----Original Message-----
>>> From: Marcus Boerger [mailto:[EMAIL PROTECTED] 
>>> Sent: Wednesday, January 07, 2004 5:09 PM
>>> To: Adam Maccabee Trachtenberg
>>> Cc: Marcus Boerger; Blake Schwendiman; [EMAIL PROTECTED]
>>> Subject: Re: [PHP-DEV] SimpleXML and Default Cast To String

>>> Hello Adam,

>>> Thursday, January 8, 2004, 12:59:19 AM, you wrote:

>>>> On Thu, 8 Jan 2004, Marcus Boerger wrote:

>>>>> From my opinion the current behavior is perfect because i see
>>> simplexml from
>>>>> an xml developers side and not from an html developers side. The
>>> former must
>>>>> typically know exactly where his strings comme from while the
> latter
>>> has
>>>>> only text to deal with and often has situations where he needs to
>>> filter out
>>>>> formatting tags like the <i> in the example.

>>>> All of my SimpleXML work is strictly XML, too. However, my thought
>> was
>>>> that I could always call strip_tags() to eliminate the information I
>>>> didn't want, but there was no apply_tags() function to do the
>>>> reverse. :) Therefore, it was better to use the other method.

>>> Well there's ext/SPL in PECL. A SimpleXML Object is also a Iterator
>> and
>>> it is a RecursiveIterator if ext/SPL is build in. Then SPL also
> offers
>> a
>>> RecursiveIteratorIterator that taks a RecursiveIterator...so it is
>> just
>>> a
>>> foreach-four-liner.

>>> $text = '';
>>> forach(new RecursiveIteratorIterator($sxe) as $el) {
>>>   $text .= $el;
>>> }

>>>>> So i'd say let us add a method for returning the complete content.
>>> Adam
>>>>> could you do that?

>>>> That wouldn't be too difficult (although I am busy for the next day
>> or
>>>> two). However, as much as I loathe toggles, I'm wondering if it
>>>> wouldn't be better to make this an object-wide setting. My thought
>> are
>>>> that on an object-by-object basis, you either always want tags or
>>>> never want them.

>>>> Something like:

>>>> $sxe = simplexml_load_file('doc.xml');
>>>> $sxe->displayTags = true;

>>>> This would keep the interface clean. Or would that just confuse
>> things
>>>> with more magic?

>>>> Also, what would the default behavior should be? I can argue both
>>>> sides of the issue right now. :)

>>> The idea is really nice but you mentioned the problems yourself it is
>>> increasing the wtf factor. Maybe we implement both getContent and
>>> getText
>>> and do this kind of magic in the next version aka 5.1?



>> Works perfect here but tell me if you find out something.

>> marcus


>> C:\Work\php\php-cvs>Debug_TS\php.exe -v
>> PHP 5.0.0RC1-dev (cli) (built: Jan  8 2004 19:06:01) (DEBUG)
>> Copyright (c) 1997-2004 The PHP Group
>> Zend Engine v2.0.0-dev, Copyright (c) 1998-2004 Zend Technologies

>> C:\Work\php\php-cvs>Debug_TS\php.exe run-tests.php ext/spl
>> ext/simplexml/tests/010.phpt

>> =====================================================================
>> CWD         : C:\Work\php\php-cvs
>> PHP         : C:\Work\php\php-cvs\Debug_TS\php.exe
>> PHP_SAPI    : cli
>> PHP_VERSION : 5.0.0RC1-dev
>> ZEND_VERSION: 2.0.0-dev
>> PHP_OS      : WINNT - Windows NT BAUMBART 5.1 build 2600
>> INI actual  : C:\Work\php\php-cvs
>> More .INIs  :
>> Extra dirs  :
>> =====================================================================
>> Running selected tests.
>> PASS SimpleXML and recursion
>> [C:\Work\php\php-cvs\ext\simplexml\tests\010.phpt]
>> PASS SPL: ArrayIterator
>> [C:\Work\php\php-cvs\ext\spl\tests\array_iterator.phpt]
>> PASS SPL: ArrayObject
>> [C:\Work\php\php-cvs\ext\spl\tests\array_object.phpt]

>> =====================================================================
>> Number of tests :    3                 3
>> Tests skipped   :    0 (  0.0%) --------
>> Tests warned    :    0 (  0.0%) (  0.0%)
>> Tests failed    :    0 (  0.0%) (  0.0%)
>> Tests passed    :    3 (100.0%) (100.0%)
>> ---------------------------------------------------------------------
>> Time taken      :    1 seconds
>> =====================================================================








-- 
Best regards,
 Marcus                            mailto:[EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to