Home » Configuration » Config » Bug #7477
Config.php declaration conflicts with other apps
Details
| Request #7477 | Config.php declaration conflicts with other apps |
|---|---|
| Submitted | 2006-04-25 01:03 UTC |
| From | profgarrett at gmail dot com |
| Status | Bogus |
| Package | Config |
| PHP Version | 4.4.0 |
| OS | WinXP Pro |
| Roadmaps | (Not assigned) |
Comments
[2006-04-25 01:03 UTC] profgarrett at gmail dot com
Description:
------------
I use Apache2Triad on my WinXP box to develop with the Elgg social networking system. With the new version of Elgg, we started using config.php as the name of our config file. However, Pear seems to declare its own config.php. Whenever we try to do declare_once('config.php'), it throws an error...
Fatal error: Cannot redeclare class config in C:\apache2triad\php\pear\Config.php on line 43
Call Stack
# Function Location
1 {main}() C:\apache2triad\htdocs\elgg05\_invite\register.php:0
2 require('C:\apache2triad\htdocs\elgg05\includes.php') C:\apache2triad\htdocs\elgg05\_invite\register.php:6
3 require_once('C:\apache2triad\php\pear\config.php') C:\apache2triad\htdocs\elgg05\includes.php:7
4 require_once('C:\apache2triad\php\pear\Config\Container.php') C:\apache2triad\php\pear\config.php:21
5 require_once('C:\apache2triad\php\pear\Config.php') C:\apache2triad\php\pear\Config\Container.php:20
I was able to confirm that the name of the config.php was the problem, as just changing it to elggconfig.php left everything working fine.
It'd be nice if someone could change the Pear declaration so it doesn't clobber an application that uses config.php as a filename.
I reported as the current version even though it isn't (pear is Pear 1.3.4), as I honestly don't want to mess up my dev environment, and frankly this really of great importance to me. Sorry if this is already fixed, but I honestly don't have time to mess with it -- I just thought someone should know if they already haven't fixed it. I tried looking thru your bug db, and didn't see anything similar.
thanks,
Nate
Test script:
---------------
Downloaded SVN code from elgg.net
[2006-04-25 02:10 UTC] ryansking at php dot net
Thank you for taking the time to write to us, but this is not
a bug.
Just change your include path to put the pear include path
after the local include path.
This is not a bug.