mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-43213 fix init regression and remove $checkphp parameter
This commit is contained in:
parent
a0e1168751
commit
9bb80d2005
6 changed files with 33 additions and 23 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue