mirror of
https://github.com/moodle/moodle.git
synced 2025-06-03 14:46:35 +02:00
A fix from boman in bug 1421 that allows the script to be
run from anywhere on the command line in PHP > 4.3.0. ie: php /some/dir/moodle/admin/php.php ... now works again
This commit is contained in:
parent
ffdd209ad2
commit
d5f286f1aa
@ -14,6 +14,14 @@
|
|||||||
$FULLME = "cron";
|
$FULLME = "cron";
|
||||||
|
|
||||||
$starttime = microtime();
|
$starttime = microtime();
|
||||||
|
|
||||||
|
/// The current directory in PHP version 4.3.0 and above isn't necessarily the
|
||||||
|
/// directory of the script when run from the command line. The require_once()
|
||||||
|
/// would fail, so we'll have to chdir()
|
||||||
|
|
||||||
|
if (!isset($_SERVER['REMOTE_ADDR']) && isset($_SERVER['argv'][0])) {
|
||||||
|
chdir(dirname($_SERVER['argv'][0]));
|
||||||
|
}
|
||||||
|
|
||||||
require_once("../config.php");
|
require_once("../config.php");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user