|
172 | 172 | $parts = explode('/', str_replace('\\', '/', dirname(__DIR__)));
|
173 | 173 | $CFG->admin = array_pop($parts);
|
174 | 174 |
|
175 |
| -//point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else |
176 |
| -//the problem is that we need specific version of quickforms and hacked excel files :-( |
| 175 | +// Point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else |
| 176 | +// the problem is that we need specific version of quickforms and hacked excel files :-(. |
177 | 177 | ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path'));
|
178 | 178 |
|
| 179 | +// The core_component class can be used in any scripts, it does not need anything else. |
179 | 180 | require_once($CFG->libdir.'/classes/component.php');
|
| 181 | + |
| 182 | +// Register our classloader, in theory somebody might want to replace it to load other hacked core classes. |
| 183 | +// Required because the database checks below lead to session interaction which is going to lead us to requiring autoloaded classes. |
| 184 | +if (defined('COMPONENT_CLASSLOADER')) { |
| 185 | + spl_autoload_register(COMPONENT_CLASSLOADER); |
| 186 | +} else { |
| 187 | + spl_autoload_register('core_component::classloader'); |
| 188 | +} |
| 189 | + |
180 | 190 | require_once($CFG->libdir.'/classes/text.php');
|
181 | 191 | require_once($CFG->libdir.'/classes/string_manager.php');
|
182 | 192 | require_once($CFG->libdir.'/classes/string_manager_install.php');
|
|
192 | 202 | require_once($CFG->libdir.'/componentlib.class.php');
|
193 | 203 | require_once($CFG->dirroot.'/cache/lib.php');
|
194 | 204 |
|
195 |
| -// Register our classloader, in theory somebody might want to replace it to load other hacked core classes. |
196 |
| -// Required because the database checks below lead to session interaction which is going to lead us to requiring autoloaded classes. |
197 |
| -if (defined('COMPONENT_CLASSLOADER')) { |
198 |
| - spl_autoload_register(COMPONENT_CLASSLOADER); |
199 |
| -} else { |
200 |
| - spl_autoload_register('core_component::classloader'); |
201 |
| -} |
202 |
| - |
203 | 205 | require($CFG->dirroot.'/version.php');
|
204 | 206 | $CFG->target_release = $release;
|
205 | 207 |
|
|
0 commit comments