Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7151 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27515 invoked by uid 1010); 17 Jan 2004 15:01:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 27489 invoked from network); 17 Jan 2004 15:01:17 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 17 Jan 2004 15:01:17 -0000 Received: from [192.168.1.100] (p508E989C.dip.t-dialin.net [80.142.152.156]) by shiva.mind.de (Postfix) with ESMTP id 0976097B66; Sat, 17 Jan 2004 16:01:11 +0100 (CET) Date: Sat, 17 Jan 2004 15:59:20 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <175-2029959906.20040117155920@marcus-boerger.de> To: Christian Schneider Cc: internals@lists.php.net In-Reply-To: <4007C8ED.9050300@cschneid.com> References: <562031508046.20040114230741@marcus-boerger.de> <19800119111039.GC2178@bumblebury.com> <1572071705312.20040115101738@marcus-boerger.de> <026101c3db83$1e80c4a0$f7dea8c0@cyberware.local> <94-2136388359.20040116102531@marcus-boerger.de> <4007C8ED.9050300@cschneid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] SimpleXML: Moving Forward From: helly@php.net (Marcus Boerger) 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[]' 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:helly@php.net