Re: Re: DOMXML support should be added to PHP5
| From: | Christian Stocker | Date: | Sun, 25 Jul 2004 13:13:06 +0000 |
| Subject: | Re: Re: DOMXML support should be added to PHP5 | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191812@lists.php.net to get a copy of this message | ||
On 25 Jul 2004 12:34:15 -0000, Scrumpy <libogen@hotmail.com> wrote:
> jasbarne@indiana.edu (Jason Barnett) wrote in
> news:20040724003530.27087.qmail@pb1.pair.com:
>
> > Well you are right that if
> > you used the old DOMXML functions in PHP4 that there is no clean way
> > to move that code forward without rewriting / supporting two
> > infrastructures. I'm not a core developer but my guess is that they
> > didn't mind dropping the support completely because in PHP4 it was all
> > tagged as "experimental".
>
> Looking at the two approaches, I preferred using DOMXML and as it was based
> on libxml2 & libxslt it seemed to be the better option.
I don't get that. The new DOM and XSL extension is still based on
libxml2 and libxslt. Actually, the whole XML support in PHP 5 is now
based on libxml2 (meaning SimpleXML, ext/xml et al. as well)
> Clearly I've learn't my lesson never to use anything tagged as experimental
> again unless I'm highly competent with that language and if necessary, be
> willing and able to code everything myself.
Transitioning from DOMXML/PHP4 to DOM/PHP5 isn't really that
complicated. You have to change some methods and most if it can be
done with find&replace (for example create_element() to
createElement() ). Some functions are not anymore available in DOM, so
you have to invest a little bit more, but the logic of you're whole
application doesn't have to be changed (one such example is
new_child(), which has to be replaced with createElement/appendChild).
I agree that writing code, which should work on PHP4 and PHP 5 is a
little bit more complicated, but feasible as well (see
http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
for a start
(reposting this link, because I think the first message by me to this
topic didn't made it to the lists..))
> > It's unfortunate for you, but I think making the change now makes
> > sense because of the new DOM / SimpleXML support.
>
> To a 'certain' extent the timing of the change is out of my hands as, like
> the majority of users, my website is hosted on a shared web server whose
> settings are out of my control.
But he will inform you some time in advance, right? ;)
[...]
>
> In the future a transitional approach in PHP to replacing any function
> should be implemented. IMO, that is part of good project/life-cycle
> management.
It's usually the approach of PHP, but due to the chaotic and
nonstandard API of DOMXML/PHP4, it was decided to make a clear cut and
not invest any time in that, but instead really concentrate on
DOM/PHP5.
Furthermore it was marked (as you realized) experimental, so "we" warned you ;)
It won't happen again. DOM/PHP5 follows the standards established by
the W3C, so there's no reason to break backwards compatibility
again... And it's not marked as experimental anymore.
>
> My hope for the future is that PHP remains accessible and attractive to new
> users. It could be all too easy for the core PHP 'guru' developers to
> become blase about this aspect of the language.
Drop your "guru" conspiracy, please ;)
The PHP core team is usually very concerned about BC (backwards
compatibility) and as you maybe realized, 99% of PHP 4 scripts run on
PHP 5 without any problems at all. The one big exception is DOMXML,
for the reasons stated above.
chregu
>
> Cheers,
> Scrumpy :)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid
0x5CE1DECB