diff --git a/lib/setup.php b/lib/setup.php index 6d641dd8f19..1fb7796a6a8 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -151,7 +151,9 @@ if (defined('ABORT_AFTER_CONFIG')) { } /** Used by library scripts to check they are being called by Moodle */ -define('MOODLE_INTERNAL', true); +if (!defined('MOODLE_INTERNAL')) { // necessary because cli installer has to define it earlier + define('MOODLE_INTERNAL', true); +} /** * Database connection. Used for all access to the database.