PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Configuration » Config » Bug #4761

Config broken in 5.1b2

Details

Submitted2005-07-07 03:37 UTC
Fromdanielr at electroteque dot org
Assignedaashley
StatusClosed
PackageConfig
PHP Version5_1 CVS-2005-07-06
OSN/A
Roadmaps(Not assigned)

Comments

[2005-07-07 03:37 UTC] danielr at electroteque dot org

Description:
------------
I upgraded to 5.1b2 on my dev machine. I get this error

Fatal error: Cannot re-assign $this in /Volumes/DATA/
www/classes/PEAR/Config/Container.php on line 125

What seems to be the issue ?

This happens just after requiring config

[2005-07-07 04:18 UTC] danielr at electroteque dot org

Where is it a duplicate, I just did a search and nothing
comes up :) Please direct me to the right bug submission
then.

[2005-07-07 06:12 UTC] ryansking at mac dot com

Sorry, I thought it was in there. Either way, its a known
issue.

[2005-07-07 06:29 UTC] danielr at electroteque dot org

Ok cool no worries, it prob aint worth fixing it. Did we
not speak about a Config2 using simplexml for PHP5 ? I'd
love to help out somehow :)

[2005-07-07 13:33 UTC] danielr at electroteque dot org

Hi there Ryan, this is problem completely stupid, but
this worked for me

if (is_null($target)) {
$target = clone($this);
}

Alot of people have had issues with assigning a variable
to $this , and the compiler thinks its trying to re-
assign $this. I also had another issue you cant do a
check for php5 version here and try something else, it
still trying to parse it within a control block :\ I
reckon for a quick move we should create a Config2 and
then port it to PHP5 completely later ?

[2005-07-07 13:51 UTC] danielr at electroteque dot org

I created a cheap and nasty patch from cvs, checks if
target is null and uses $this instead of $target and has
to duplicate the block and add an extra if else
statement :\

www.electroteque.org/Config/Container.diff

[2006-02-14 00:21 UTC] aashley at php dot net

None of the problems mentioned here are reproducable in PHP5.1.2. Closing.

[2006-02-14 00:29 UTC] danielr at electroteque dot org

Damn late reply ? LOL , i now have 5.1.2 and its ok. Are
you thinking of adding caching to the configs at all ?
Also is there a PHP5 version of this which uses the
native xml methods ?

[2006-02-14 00:55 UTC] aashley at php dot net

It's morning here and I'm working through the bug list preparing for a new patch release.

Caching is better left up to the application developer to integrate it within their system better, if you have Config loaded before hand you should be able to just write the config object to a cache system and have it serialise and deserialise just fine.

Currently no there isnt a PHP5 only version of Config and I have no immediate plans to create one. I have problems with the current Config under PHP5.