Hello

I have tried this code and it seems to work in 99% of the cases. However, when working from other paths (in 2.0 we have several popups which are launched from common/launcher) this results in the url being http://localhost/common/launcher/ instead of http://localhost/ which gives several problems. I think we can avoid this by launching everything directly from the root.

Best regards
Sven

--
Met vriendelijke groeten

Sven Vanpoucke
Digitaal Leren
Directie Onderwijs
Hogeschool Gent
http://digitaal-leren.hogent.be/



Op 27/09/10 09:57, Peter Bex schreef:
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
Dev@lists.chamilo.org
http://lists.chamilo.org/listinfo/dev



_______________________________________________
Dev mailing list
Dev@lists.chamilo.org
http://lists.chamilo.org/listinfo/dev

Reply via email to