FAQ
Forwarding the following from a fellow Gentoo developer:

The tests for XML_CSSML and XML_XPath appear to fail because they are
trying to re-assign $this, which php 5 at least doesn't appear to like.
Note that this is happening in the classes inside of the individual
packages and not in the example php files.

--
Sebastian Bergmann http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

Search Discussions

  • Arnaud Limbourg at Sep 19, 2005 at 7:42 pm
    I contacted Dan to know if he is still willing to maitain those packages.

    Arnaud.

    Sebastian Bergmann wrote:
    Forwarding the following from a fellow Gentoo developer:

    The tests for XML_CSSML and XML_XPath appear to fail because they are
    trying to re-assign $this, which php 5 at least doesn't appear to like.
    Note that this is happening in the classes inside of the individual
    packages and not in the example php files.
  • Arnaud Limbourg at Sep 20, 2005 at 5:08 am
    For the record Dan cannot work on the packages he has a lead role. The
    packages are orphaned.

    I have marked dan as inactive on all his packages.

    Arnaud.

    Arnaud Limbourg wrote:
    I contacted Dan to know if he is still willing to maitain those packages.

    Arnaud.

    Sebastian Bergmann wrote:
    Forwarding the following from a fellow Gentoo developer:

    The tests for XML_CSSML and XML_XPath appear to fail because they are
    trying to re-assign $this, which php 5 at least doesn't appear to like.
    Note that this is happening in the classes inside of the individual
    packages and not in the example php files.
  • Sebastian Bergmann at Oct 9, 2005 at 9:13 am

    Sebastian Bergmann schrieb:
    The tests for XML_CSSML and XML_XPath appear to fail because they are
    trying to re-assign $this, which php 5 at least doesn't appear to like.
    Note that this is happening in the classes inside of the individual
    packages and not in the example php files.
    Helgi Þormar Þorbjörnsson fixed XML_CSSML in CVS. Could someone please
    test his changes and roll a new release? Thanks!

    --
    Sebastian Bergmann http://www.sebastian-bergmann.de/
    GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
  • Helgi Þormar at Oct 9, 2005 at 1:11 pm

    On Sun, 09 Oct 2005 11:11:36 +0200, Sebastian Bergmann wrote:

    Sebastian Bergmann schrieb:
    The tests for XML_CSSML and XML_XPath appear to fail because they are
    trying to re-assign $this, which php 5 at least doesn't appear to like.
    Note that this is happening in the classes inside of the individual
    packages and not in the example php files.
    Helgi Þormar Þorbjörnsson fixed XML_CSSML in CVS. Could someone please
    test his changes and roll a new release? Thanks!
    I didn't tho fix the issue of wrong installation path, which is a
    potential BC issue.

    See: http://pear.php.net/bugs/bug.php?id=5574

    QA needs to come to some conclusion what should be done.

    - Helgi
  • Arnaud Limbourg at Oct 10, 2005 at 8:01 am

    I didn't tho fix the issue of wrong installation path, which is a
    potential BC issue.

    See: http://pear.php.net/bugs/bug.php?id=5574

    QA needs to come to some conclusion what should be done.
    The install path is correct (I updated the bug with this comment).

    An issue though is related to PHP 5. I run 5.1.0-RC1 which throws a
    fatal error because this package uses $this reassignement trick.

    I can add a dep so the package cannot be installed under PHP5. People
    installing the current release under PHP5 are in for trouble. It has
    been downloaded > 21,000 times so far.

    I don't see any other way out, except if we put a big warning telling
    people need to update their scripts to use the factory method. That
    would break BC though.

    Arnaud.
  • Arnaud Limbourg at Oct 10, 2005 at 8:05 am
    To be clearer it boils down to two choices:

    - add a dependency on PHP4, so it cannot be installed under PHP5
    - add a warning telling people to update their script to use the factory
    method and remove the $this reassignment trick
  • bertrand Gugger at Oct 10, 2005 at 9:15 am
    Bonjour,
    Arnaud Limbourg wrote:
    To be clearer it boils down to two choices:

    - add a dependency on PHP4, so it cannot be installed under PHP5
    - add a warning telling people to update their script to use the factory
    method and remove the $this reassignment trick

    I still believe it's possible to correct this bug for any PHP
    The trick could be done by adding a private property:
    $_theObj = null;
    if the constructor is called instead of the factory do:
    $this->_theObj = $this->factory($in_driver, $in_CSSML,
    $in_type, $in_params);
    then correct all the methods in CSSML.php as:
    function load()
    {
    if ($this->_theObj) {
    return $this->_theObj->load();
    }
    if ($this->loaded) {
    return PEAR::raiseError(null, XML_CSSML_ALREADY_EXISTS,
    null, E_USER_WARNING, $this->CSSMLDoc, 'XML_CSSML_Error', true);
    }
    }
    etc...
    my 2cts
    à+
    --
    bertrand "toggg" Gugger
  • bertrand Gugger at Oct 10, 2005 at 11:01 am
    Auto reply after an IRC discussion:
    bertrand Gugger wrote:
    Bonjour,
    Arnaud Limbourg wrote:
    To be clearer it boils down to two choices:

    - add a dependency on PHP4, so it cannot be installed under PHP5
    - add a warning telling people to update their script to use the factory
    method and remove the $this reassignment trick

    I still believe it's possible to correct this bug for any PHP
    The trick could be done by adding a private property:
    $_theObj = null;
    if the constructor is called instead of the factory do:
    $this->_theObj = $this->factory($in_driver, $in_CSSML,
    $in_type, $in_params);
    then correct all the methods in CSSML.php as:
    function load()
    {
    if ($this->_theObj) {
    return $this->_theObj->load();
    }
    if ($this->loaded) {
    return PEAR::raiseError(null, XML_CSSML_ALREADY_EXISTS,
    null, E_USER_WARNING, $this->CSSMLDoc, 'XML_CSSML_Error', true);
    }
    }
    etc...
    my 2cts
    à+
    Constructor should be (missed the &)
    $this->_theObj = & $this->factory($in_driver, $in_CSSML, $in_type,
    $in_params);
    Also the properties to reassign in this case:
    $this->loaded = &$this->_theObj->loaded;
    ... etc.
    This methods and properties "reassignments" should be done for all
    methods/properties inclusive what the drivers create.
    On this way, 100% BC is guaranted for the standard package.
    People customizing the drivers will have to use the "factory"

    This adaptation only takes place for users of the constructor, will make
    no difference (1 extra if () ) for the right "factory" users.

    If the cops here agree, I can do it, test it and commit it so the
    QA-team can release it.
    à+
    --
    bertrand "toggg" Gugger
  • Helgi Þormar at Oct 10, 2005 at 2:41 pm

    On Mon, 10 Oct 2005 13:09:00 +0200, bertrand Gugger wrote:

    If the cops here agree, I can do it, test it and commit it so the
    QA-team can release it.
    à+
    Yeah, just go ahead and do it, tho I think it's kinda of a extra work just
    to support a obviously wrong way :P (assignment to this that is)

    - Helgi
  • bertrand Gugger at Oct 11, 2005 at 5:56 am
    Bonjour,
    Helgi Þormar wrote:
    On Sun, 09 Oct 2005 11:11:36 +0200, Sebastian Bergmann wrote:


    Sebastian Bergmann schrieb:

    The tests for XML_CSSML and XML_XPath appear to fail because they are
    trying to re-assign $this, which php 5 at least doesn't appear to like.
    Note that this is happening in the classes inside of the individual
    packages and not in the example php files.
    Helgi Þormar Þorbjörnsson fixed XML_CSSML in CVS. Could someone please
    test his changes and roll a new release? Thanks!
    I didn't tho fix the issue of wrong installation path, which is a
    potential BC issue.

    See: http://pear.php.net/bugs/bug.php?id=5574

    QA needs to come to some conclusion what should be done.

    - Helgi

    This package is just a nightmare.
    I started the job, so naturally hooked on the package.xml where I
    already fixed the example file name and put a right date so pear install
    package.xml could work.
    Actually the install path is now conform (XML/CSSML...) what breaks BC
    as it was previously under XML_CSSML !
    Dunno if the installer can build a link to correct this ...

    Anyway, to the end, I could run the example, so now I'm ready to do the job.

    Actually, helgi's fix for the $this assignment won't work: PHP5 issues
    this fatal in the pre-scan phase, so make this assignment conditionnaly
    does not change anything.
    I will then (try to) apply the scheme I described

    Wish me courage and luck :)
    à+
    --
    bertrand "toggg" Gugger
  • Arnaud Limbourg at Oct 11, 2005 at 7:20 am

    This package is just a nightmare.
    I started the job, so naturally hooked on the package.xml where I
    already fixed the example file name and put a right date so pear
    install package.xml could work.
    Actually the install path is now conform (XML/CSSML...) what breaks
    BC as it was previously under XML_CSSML !
    Dunno if the installer can build a link to correct this ...
    The package.xml hasn't changed much in the past two years and the
    install dir as
    always been correct. The file gets installed as XML/CSSML.php which is
    correct.
    Wish me courage and luck :)
    I wonder if we shouldn't go the "BIG WARNING with a dep on PHP4 and new
    release
    with a dep on PHP5" way, using $this is so wrong. Would it break many scripts
    is the question.

    Thoughts ?

    Arnaud.
  • bertrand Gugger at Oct 11, 2005 at 9:04 am
    re
    Arnaud Limbourg wrote:
    This package is just a nightmare.
    I started the job, so naturally hooked on the package.xml where I
    already fixed the example file name and put a right date so pear
    install package.xml could work.
    Actually the install path is now conform (XML/CSSML...) what breaks
    BC as it was previously under XML_CSSML !
    Dunno if the installer can build a link to correct this ...

    The package.xml hasn't changed much in the past two years and the
    install dir as
    always been correct. The file gets installed as XML/CSSML.php which is
    correct.
    Wish me courage and luck :)

    I wonder if we shouldn't go the "BIG WARNING with a dep on PHP4 and
    new release
    with a dep on PHP5" way, using $this is so wrong. Would it break many
    scripts
    is the question.

    Thoughts ?

    Arnaud.
    Another question occurs which will perhaps solve the problem:
    Can sound strange for many people, but I allways build my tests *before*
    trying to repair such catasthrops.
    So, I need a PHP5 with the domxml extension. It appears, domxml is no
    more bundled in php but exists only as pecl extension. [1]
    Now, and it was confirmed by chregu on IRC:
    "This extension allows you to operate on an XML document with the DOM
    API. It has been superseded by the DOM extension that ships with PHP 5.
    Although it should be possible to use this old domxml extension with PHP
    5, its use is highly discouraged, as there a very high potential for
    conflicts with the new dom extension." [2]

    So, half of the package is deprecated on PHP5 , the other half depending
    on Sablotron.
    What means, quite no other solution exists than:
    1) releasing a PHP4 only fixbug, with no changes , or quite
    2) creating a PHP5 (and perhaps PHP4 compat) new XML_CSSML2 if not
    XML_CSSML5
    This new package could make use of the bundled DOM [3] instead of domxml

    Just, alternatively:
    * it could perhaps be possible to use pear installer new features to
    have a different installation depending on the php version
    * the class could test for the existence of domxml or dom functions and
    call the corresponding driver.

    [1] http://fr.php.net/manual/en/ref.domxml.php
    [2] http://pecl.php.net/package/domxml
    [3] http://fr.php.net/manual/en/ref.dom.php

    à+
    --
    bertrand "toggg" Gugger
  • Helgi Þormar at Oct 11, 2005 at 11:50 am

    On Tue, 11 Oct 2005 08:03:23 +0200, bertrand Gugger wrote:

    Actually, helgi's fix for the $this assignment won't work: PHP5 issues
    this fatal in the pre-scan phase, so make this assignment conditionnaly
    does not change anything.
    Well I did say that I didn't test :-)

    - Helgi
  • bertrand Gugger at Oct 11, 2005 at 10:35 am
    Halo,
    Sebastian Bergmann wrote:
    Forwarding the following from a fellow Gentoo developer:

    The tests for XML_CSSML and XML_XPath appear to fail because they are
    trying to re-assign $this, which php 5 at least doesn't appear to like.
    Note that this is happening in the classes inside of the individual
    packages and not in the example php files.

    We come on dra(ma|s)tic solutions, here :
    The onliest way is to restrict XML_CSSML to php4 and issue an XML_CSSML2
    php5 compat, what means some delays. ( should go right thru pepr ? )
    Sebastian, depending on the urgence, my solution could be temporarly,
    unofficially distributed, in what kind of conf do you need it ?

    For the existing XML_CSSML, I will change locally, test and commit in cvs:
    * strict dependency on php4, needs to check the 4.4.0 branch too
    * dynamically check the requested extension is present
    * keep the $this assignment <sighs>
    In order QA can release.

    Please, comment ASAP as I don't want to lay here. But yes, no hastly
    decision too.

    I first realize the XML_Xpath is also concerned, will take a look too.
    à+
    --
    bertrand "toggg" Gugger
  • Sebastian Bergmann at Oct 12, 2005 at 6:46 am

    bertrand Gugger schrieb:
    * strict dependency on php4, needs to check the 4.4.0 branch too
    * dynamically check the requested extension is present
    * keep the $this assignment <sighs>
    In order QA can release.
    Sounds like the only reasonable thing we can do now. (Apart from banning
    such a nightmare of a package from PEAR.)

    Thanks,
    Sebastian

    --
    Sebastian Bergmann http://www.sebastian-bergmann.de/
    GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
  • bertrand Gugger at Oct 12, 2005 at 12:42 pm
    Bonjour,
    Sebastian Bergmann wrote:
    bertrand Gugger schrieb:

    * strict dependency on php4, needs to check the 4.4.0 branch too
    * dynamically check the requested extension is present
    * keep the $this assignment <sighs>
    In order QA can release.
    Sounds like the only reasonable thing we can do now. (Apart from banning
    such a nightmare of a package from PEAR.)

    Thanks,
    Sebastian

    Done : http://marc.theaimsgroup.com/?l=pear-cvs&m=112912070532752&w=2
    So far I could check , QA can now release.
    --
    bertrand "toggg" Gugger
  • bertrand Gugger at Oct 12, 2005 at 2:59 pm
    re
    Sebastian Bergmann wrote:
    Forwarding the following from a fellow Gentoo developer:

    The tests for XML_CSSML and XML_XPath appear to fail because they are
    trying to re-assign $this, which php 5 at least doesn't appear to like.
    Note that this is happening in the classes inside of the individual
    packages and not in the example php files.

    The problem is also solved for XML_XPath
    http://marc.theaimsgroup.com/?l=pear-cvs&m=112912855212157&w=2
    Here, it was just an assignment to $this in case of error, I repaired it
    by adapting the isError() method and 2 other assignments to clear the
    object, it's only clearing the properties now.

    So QA can also release this package, here no php version limitation.
    à+
    --
    bertrand "toggg" Gugger
  • Arnaud Limbourg at Oct 12, 2005 at 3:23 pm
    For the record, both packages were released today.

    Arnaud.
  • Sebastian Bergmann at Oct 16, 2005 at 6:09 am

    Arnaud Limbourg schrieb:
    For the record, both packages were released today.
    Got the following message from my fellow Gentoo developer:

    When testing PEAR-XML_XPath, I found that it appears to depend on the
    PEAR_Error class provided by PEAR-PEAR. However, the current version
    of PEAR-PEAR appears to have deprecated PEAR_Error in favor of
    PEAR_ErrorStack.

    Also, in trying to test that PEAR-XML_XPath actually works, the
    example script XML_XPath_example.php fails with the following;

    Fatal error: Call to undefined function domxml_open_mem() in
    /usr/share/php/XML/XPath.php on line 142

    It looks like XML_XPath needs a "PHP 4 only" dependency, too, just like
    XML_CSSML.

    --
    Sebastian Bergmann http://www.sebastian-bergmann.de/
    GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
  • Helgi Þormar at Oct 16, 2005 at 6:27 am

    On Sun, 16 Oct 2005 08:08:11 +0200, Sebastian Bergmann wrote:

    Arnaud Limbourg schrieb:
    For the record, both packages were released today.
    Got the following message from my fellow Gentoo developer:

    When testing PEAR-XML_XPath, I found that it appears to depend on the
    PEAR_Error class provided by PEAR-PEAR. However, the current version
    of PEAR-PEAR appears to have deprecated PEAR_Error in favor of
    PEAR_ErrorStack.
    This is false, it has not been deprecated and probably never will be,
    ErrorStack is simply a more sophisticated alternative to PEAR_Error.
    Also, in trying to test that PEAR-XML_XPath actually works, the
    example script XML_XPath_example.php fails with the following;

    Fatal error: Call to undefined function domxml_open_mem() in
    /usr/share/php/XML/XPath.php on line 142

    It looks like XML_XPath needs a "PHP 4 only" dependency, too, just like
    XML_CSSML.
    Also "false", if one takes a look at www.php.net/domxml then you can see
    it's a PECL ext that is said to "work" on PHP 5, so placing a domxml
    dep is the way to go, then again, how well does it "work" under PHP 5 ?
    Well maybe PHP 4 dep is the way to go if one wants no problem from this
    thing, guess someone should write a decent PHP 5 support to XPath.

    - Helgi
  • Sebastian Bergmann at Oct 16, 2005 at 6:48 am

    Helgi Þormar schrieb:
    guess someone should write a decent PHP 5 support to XPath.
    PHP 5 has out-of-the-box support for XPath in both DOM and SimpleXML.

    --
    Sebastian Bergmann http://www.sebastian-bergmann.de/
    GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
  • Helgi Þormar at Oct 16, 2005 at 4:22 pm

    On Sun, 16 Oct 2005 08:46:08 +0200, Sebastian Bergmann wrote:

    Helgi Þormar schrieb:
    guess someone should write a decent PHP 5 support to XPath.
    PHP 5 has out-of-the-box support for XPath in both DOM and SimpleXML.
    ohh right, forgot about that, so yeah PHP 4 dep.

    - Helgi
  • Arnaud Limbourg at Oct 18, 2005 at 5:26 am

    On Sun, 16 Oct 2005 08:46:08 +0200, Sebastian Bergmann wrote:
    Helgi Þormar schrieb:
    guess someone should write a decent PHP 5 support to XPath.
    PHP 5 has out-of-the-box support for XPath in both DOM and SimpleXML.
    ohh right, forgot about that, so yeah PHP 4 dep.
    Version 1.2.3 has been released with the added dependency.

    Arnaud.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-qa @
categoriesphp
postedSep 19, '05 at 9:45a
activeOct 18, '05 at 5:26a
posts24
users4
websitepear.php.net

People

Translate

site design / logo © 2023 Grokbase