On Sun, Sep 26, 2010 at 03:32:24PM +0200, Hans De Bisschop wrote: > You beat me to it Yannick. It's indeed not the system paths which are > an issue, we've been handling those with realpath() for as long as I > can remember. Discussed the issue with Sven yesterday too and the > $_SERVER-variable also came up. At the veyr least we're going to look > into the matter. > Hans
If you're looking for some code, here's some hairy code from the CASCO framework that tries to determine the base paths for web and disk: http://wush.net/trac/casco/browser/trunk/lib/casco/bootstrap.php See lines 34--46. The final value of the base URL ends up in casco::$httproot and the final value of the filename ends up in casco::$docroot. Both always include a trailing slash, so resource names can simply be appended to these strings. It has been tested both with CASCO applications running from the webserver's docroot, as well as from a subdirectory. This works on both Windows and Unix, and has been tested with Apache and Lighttpd. HTTPS support has been tested under Lighttpd. I'd be interested to hear reports about how it works with IIS. FWIW, I think using relative pathnames is hard to get right, especially if you want to support running Chamilo from a subdirectory, which is a very useful thing when developing Chamilo and having several versions running on http://localhost, since it requires less messing around with /etc/hosts Cheers, Peter Bex Solide ICT - http://www.solide-ict.nl _______________________________________________ Dev mailing list [email protected] http://lists.chamilo.org/listinfo/dev
