MDL-40500 move MOODLE_INTERNAL define before core_component include

This resolves problems with MOODLE_INTERNAL in db/subplugins.php
This commit is contained in:
Petr Škoda
2013-07-04 19:04:23 +02:00
parent f8e6e5bc30
commit 9240ecbd98
+5 -5
View File
@@ -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');