Thatīs my problem: I have The RSGallery2 instaled and when I patch the joomla files, RSGallery crashes reporting the next error:
Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in /home/xxxxxx/public_html/administrator/components/com_smf/includes/PEAR.php:765) in /home/xxxxxx/public_html/includes/PEAR/PEAR.php on line 796
Apparently the RSGallery is using a require to include PEAR.php. To be a good 3rd party component(and work well with other components) they should be using require_once(or include_once) so that you don't get this error message.
and, is there a solution for that problem?? Should I include some code in Pear.php or in another file?. (the problem appears when I force to overwrite the index.php file with the hack) Thanks a lot again.
« Last Edit: February 04, 2007, 02:58:27 PM by Javi »
Apparently the RSGallery is using a require to include PEAR.php. To be a good 3rd party component(and work well with other components) they should be using require_once(or include_once) so that you don't get this error message.
Beeing one of the RSGallery2 developers I can assure you there are no require statements in RSGallery2, only require_once(), so I don't like the suggestion without bothering to check first. Also com_smf is not using require statements, so this is a difficult one.
No negative implication intended, a fatal error in php is only produced by a require, hence my comment. I hate having to include PEAR in my component but I have found it is unreliable to assume a webhost has PEAR available. Unfortunately I have no exposure to RSGallery but that doesn't mean I shouldn't have checked. Can you provide a link to any discussion you might be having on your site about this so we can keep them up to date?
After assessing the error message again, it appears this is due to the two different locations of PEAR. Javi, can you provide your php include path?
After assessing the error message again, it appears this is due to the two different locations of PEAR. Javi, can you provide your php include path?
Wolverine,
This could be the problem. Your component provides it's own copy of the PEAR library, as RSGallery2 uses the PEAR library packed in the Joomla core. Is there a specific reason you do not use the PEAR from the Joomla Core?
If I recall correctly Joomla was packaging an older copy of PEAR or some other problem, I don't remember exactly. Ill get to testing without it and report back.
Preliminary testing shows no problems with removing the copy of PEAR in com_smf. Javi, remove the file PEAR.php from administrator/components/com_smf/includes/ and it should start working properly for you.
Preliminary testing shows no problems with removing the copy of PEAR in com_smf. Javi, remove the file PEAR.php from administrator/components/com_smf/includes/ and it should start working properly for you.
Thanks for the help Ronald!
No problem wolverine, we devs have to stick together!
Are you sure removing the file will do the trick? What about the require statements to your copy of PEAR in the different files of com_smf?
they only require 'PEAR.php', so if it's in the include it should not be a problem. I did not have it with any path, I simply appended the include path with the cwd.
I've just deleted the file, but a new error is reported (similar, but not the same: now in /usr/lib/php/PEAR.php)
Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in /usr/lib/php/PEAR.php:765) in /home/xxxxx/public_html/includes/PEAR/PEAR.php on line 796
It happens 1 hour after deleting PEAR.php from administrator/components/com_smf/includes (approx.)
thanks.
« Last Edit: March 08, 2007, 03:39:35 AM by Javi »
they only require 'PEAR.php', so if it's in the include it should not be a problem. I did not have it with any path, I simply appended the include path with the cwd.
Wolverine,
i think the problem with this is that most components use the PEAR library provided by Joomla, because not all servers provide a PEAR library as a standard service. When you include without path, the script will search through the included paths as set in the php.ini first. If the server does not have PEAR available, this won't work, as the Joomla PEAR library is not in the include path set on the server.
The safest way in my opinion is to let com_smf rely on the PEAR library provided by Joomla, so this conflict between different components won't appear, like this:
Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved. Terms of Use