Files like report.php that start with loading config.php, do not need to perform the MOODLE_INTERNAL check. Also, the recommended pattern for request handlers like this is to use require() to load the config.php, and then use require_once() to load any additional library needed.
https://docs.moodle.org/dev/Coding_style#Require_.2F_include
Files like report.php that start with loading config.php, do not need to perform the MOODLE_INTERNAL check. Also, the recommended pattern for request handlers like this is to use
require()to load the config.php, and then userequire_once()to load any additional library needed.https://docs.moodle.org/dev/Coding_style#Require_.2F_include