Commit f4b09090 authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

Play nicely if we're running from the commandline

parent 49baca97
......@@ -55,7 +55,7 @@ $CFG = (object)array_merge((array)$cfg, (array)$CFG);
foreach (array('docroot', 'dataroot') as $path) {
$CFG->{$path} = (substr($CFG->{$path}, -1) != DIRECTORY_SEPARATOR) ? $CFG->{$path} . DIRECTORY_SEPARATOR : $CFG->{$path};
}
if (!isset($CFG->wwwroot)) {
if (!isset($CFG->wwwroot) && isset($_SERVER['HTTP_HOST'])) {
$proto = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
$path = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT']));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment