From: <no...@se...> - 2007-03-01 09:45:42
|
Hi folks, I've got a strong dislike for the committed pathing fix by Alex and I want to disargee the need of such a global variable like $root_path. As fas as I can see there is no need for a global variable in a library such as OpenDocumentPHP anyway. Let think of the following scenarios: a) You are root of you webserver and have total control: You can put OpenDocumentPHP where ever you want and can add the Path to the classpath either by put it in the php.ini or adding it with a propper set_ini statement. b) You are nor root neither have total control: In this case you can ask your administrator to add it to the php classpath, which he/she probably don't. You can try to add it with a propper set_ini statement, which will probably won't work. Or, and this will allways work, you put the directory OpenDocumentPHP/ in the same directory (as a subdirectory) as you application. Because your application is in the classpath, the require_once statement will find the OpenDocumentPHP stuff anyway. Planed before 0.6.0 is also a PEAR package, so you can install OpenDocumenPHP as simple as: > pear discover-channel pear.opendocumentphp.org > pear install opendocumentphp/OpenDocumentPHP In this case OpenDocumentPHP will be in your PEAR directory and this should work for end users and developers. But why is a global variable, like Alex did it, such a bad thing, you may ask? The answers is easy: It is not OOP and you, as a library developer, don't know if an other application needs exactly this variable for something different. If I am (totally) wrong, please stand up and tell me what I am miss! Yours, Norman |