Hello everyone!
Just started as a Learning Technologist at Cranfield Uni. My role doesn't give me backend access to Moodle so I've set up my own copy of Moodle (3.1) on a web server I own so that I can develop some scripts to improve our automation there before submitting them to our actual VLE.
I've hit a problem while trying to make a script that makes a database query using the moodle_database.php file in /lib/dml/ . After a lot of debugging it looks like the moodle_database.php file (which comes as part of the installation process for moodle - it's not a file I made) hangs and gets stuck at the very top on the
defined('MOODLE_INTERNAL') || die();
line. I can only assume that this means MOODLE_INTERNAL is not defined. However I don't know why. Does anyone know why this part of a file that comes with Moodle could be having a problem?My copy of the VLE seems otherwise able to create courses etc which makes me think it's able to make database calls fine.
The script file I'm writing IS in a different directory and is using a relative path to include the file like so:
include_once("../lib/dml/moodle_database.php");The file is definitely being found and loaded.
Thanks for your help!
Miles