MDL-43213 fix init regression and remove $checkphp parameter

This commit is contained in:
Petr Skoda 2013-12-19 12:29:05 +08:00 committed by David Monllao
parent a0e1168751
commit 9bb80d2005
6 changed files with 33 additions and 23 deletions

View file

@ -38,7 +38,13 @@ function testing_cli_argument_path($moodlepath) {
$moodlepath = preg_replace('|^/admin/|', "/$CFG->admin/", $moodlepath);
}
$cwd = getcwd();
if (isset($_SERVER['REMOTE_ADDR'])) {
// Web access, this should not happen often.
$cwd = dirname(dirname(__DIR__));
} else {
// This is the real CLI script, work with relative paths.
$cwd = getcwd();
}
if (substr($cwd, -1) !== DIRECTORY_SEPARATOR) {
$cwd .= DIRECTORY_SEPARATOR;
}