[dev] Horde webroot detection fails here

Aurelien Bompard gauret at free.fr
Sun Feb 13 03:32:42 PST 2005


Hi all,

At the top of the config/registry.php, there is a line to detect the web
root :
$webroot = strstr(dirname(__FILE__), '/' . array_shift(preg_split(';/;',
$_SERVER['PHP_SELF'], 2, PREG_SPLIT_NO_EMPTY)));

This function fails here because I have installed Horde in
"/home/horde/htdocs/horde". The detected webroot is "/horde/htdocs/horde"
instead of "/horde".
The best solution (I can think of) would be to search for "horde" from the
end of the string, but there is no function in php to do that before PHP5.
However, this page: http://www.php.net/manual/function.strrpos.php
contains many user comments proposing such a function.

Could one of them be added to registry.php ?
Maybe something like this is already included in PEAR, but I don't know it
well.

Thanks

Aurélien
-- 
http://gauret.free.fr   ~~~~   Jabber : gauret at amessage.info
For external use only




More information about the dev mailing list