Hello Christian,

Friday, January 16, 2004, 12:20:13 PM, you wrote:

> Marcus Boerger wrote:
>> Just a node: The thing you saw required SXE objects implementing
>> interface RecursiveIterator{reset(), hasMore(), key(), current(),
>> next(), hasChildren(), getChildren()}

> Excuse my ignorance: As I wasn't at ApacheCon I'm not sure what Adam was 
> talking about, is the SXE/RecursiveIterator stuff what makes foreach 
> possible?

During Frankfurt Conf Sterling and me discused the general foreach things
and i made them work. During ApacheCon i started with the RecursiveIterator
and finally made the whole foreach thing work. After the show i also made
the RecursiveIterator work. That's a typical form of php development.
Sometimes we meet live or on irc, discuss ideas and implement them. The
current situation is very much different as you should know by now.

>> That's exactly why dimity tried to implement $obj->node[0]. And i guess this
>> is vital to the extension.

> Again: Is $obj->node[0] needed to provide foreach in all cases (0, 1 or 
> more elements)? Or is this another way of accessing the elements?

The term '->xyz' (or in other words property access) could address different
things. If there is only one node of the same name then it returns the
object for that node. If there are more nodes of the same type then it
returns an array of the node objects. Hence '->xyz[<n>]' allows to always
return a single node object and therefore '->xyz[0]' always returns the node
object for the first node no matter how many nodes of the same name there
are.

>> To achieve that the property ready handler would have to return an array or
>> iterator class always. That's all that needs to be changed. Unfortunatley
>> this would be a major change of functionality so feel free to drop proeprty
>> handling completley.

> Again I can't follow the conclusion your drawing. I think people on the 
> list here expressed what they'd like to see as functionality (i.e. how 
> they'd use SimpleXML). If it needs a major change so be it.

That's a problem though. If people don't understand i am fine with them
telling us what they would like to see. But believe me Sterling, Rob and me
have spend lots of time in implementing this. Somtimes such sentences are
only said to denote that there are certain problems. And sometimes i think
it is ok if only a few people understand the full thing. (bla bla)

>> I guess it can be done by simply fixing the refcounting. So why not start
>> some work/analysis instead of mucking around? The least bit you could do is
>> writing some test files under test subdirectory.

> I think the problem right now is that noone feels responsible to go and 
> start coding. Old dilemma: If you start coding too early people get 
> upset because you didn't ask first. And if you want to nail down the 
> specs first you get accused of 'only mucking around'.

> So who's responsible for SimpleXML now and what are the specs? I'd be 
> willing to provide some code if the person in charge wants help, I don't 
> have the knowledge or karma on this list to lead the development though, 
> that's for sure. So give me specs and I give you e.g. test cases :-)

Fine. Responsible are Sterling, me and rob. Also Andi is the RM so as long
as we haven't released php 5.0 those three persons are the ones who should
do the main decisions.

Things that need to be adressed that can be fixed inside the extension and
that won't affect other behavior are handling of attribute values by
proxies. Currently you cannot do '$obj["attribute"] += $value;'. This is
because the dimension read handler returns the value. This must be changed
to a proxy class so that changing that value would result in an update of
the original object. If you really want to do any coding then that's the
place to start.



-- 
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