From 9240ecbd983dc0dd0b286e89deeafcfbfdd1847b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Thu, 4 Jul 2013 19:04:23 +0200 Subject: [PATCH] MDL-40500 move MOODLE_INTERNAL define before core_component include This resolves problems with MOODLE_INTERNAL in db/subplugins.php --- lib/setup.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/setup.php b/lib/setup.php index bd590d7bf2d..32453f7d5cc 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -289,6 +289,11 @@ umask(0000); $CFG->yui2version = '2.9.0'; $CFG->yui3version = '3.9.1'; +if (!defined('MOODLE_INTERNAL')) { // Necessary because cli installer has to define it earlier. + /** Used by library scripts to check they are being called by Moodle. */ + define('MOODLE_INTERNAL', true); +} + // core_component can be used in any scripts, it does not need anything else. require_once($CFG->libdir .'/classes/component.php'); @@ -316,11 +321,6 @@ if (defined('ABORT_AFTER_CONFIG')) { } } -/** Used by library scripts to check they are being called by Moodle */ -if (!defined('MOODLE_INTERNAL')) { // necessary because cli installer has to define it earlier - define('MOODLE_INTERNAL', true); -} - // Early profiling start, based exclusively on config.php $CFG settings if (!empty($CFG->earlyprofilingenabled)) { require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');