run from anywhere on the command line in PHP > 4.3.0.
ie:
php /some/dir/moodle/admin/php.php
... now works again
$FULLME = "cron";
$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");