I would like my cron job to have access to the configuration strings stored by Moodle when I configured external DB enrollment-- e.g. database name, host, db type, db user, password, and so on.
Where does Moodle save these values? Are they available through some global like the "$CFG" variables in config.php are, for Moodle's own internal database?
Thanks!
those settings are "saved" in the config.php file, they are accessible to other php scripts using $CFG by including the config.php file like this:
require_once("/home/dan/moodle/config.php");
global $CFG;
(where /home/dan/moodle is the path to your moodle site.)
hope that helps.
thanks,
Dan
require_once("/home/dan/moodle/config.php");
global $CFG;
(where /home/dan/moodle is the path to your moodle site.)
hope that helps.
thanks,
Dan
I was looking for the settings for the external enrollment db, not the local MySQL db. But poking around I found them the in mdl_config table. I used the values in the config.php file you pointed me to in order to have the cron job connect to the local MySQL db, get the right values from the msl_config table, connect to the external db, and get what it needs.
So in the end it all worked out!
Thanks for you help.
Alan
So in the end it all worked out!
Thanks for you help.
Alan