Exemple #1
0
if (!empty($_SERVER['HTTP_X_moz']) && $_SERVER['HTTP_X_moz'] === 'prefetch') {
    header($_SERVER['SERVER_PROTOCOL'] . ' 404 Prefetch Forbidden');
    echo 'Prefetch request forbidden.';
    exit(1);
}
//point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else
//the problem is that we need specific version of quickforms and hacked excel files :-(
ini_set('include_path', $CFG->libdir . '/pear' . PATH_SEPARATOR . ini_get('include_path'));
// Register our classloader, in theory somebody might want to replace it to load other hacked core classes.
if (defined('COMPONENT_CLASSLOADER')) {
    spl_autoload_register(COMPONENT_CLASSLOADER);
} else {
    spl_autoload_register('core_component::classloader');
}
// Remember the default PHP timezone, we will need it later.
core_date::store_default_php_timezone();
// Load up standard libraries
require_once $CFG->libdir . '/filterlib.php';
// Functions for filtering test as it is output
require_once $CFG->libdir . '/ajax/ajaxlib.php';
// Functions for managing our use of JavaScript and YUI
require_once $CFG->libdir . '/weblib.php';
// Functions relating to HTTP and content
require_once $CFG->libdir . '/outputlib.php';
// Functions for generating output
require_once $CFG->libdir . '/navigationlib.php';
// Class for generating Navigation structure
require_once $CFG->libdir . '/dmllib.php';
// Database access
require_once $CFG->libdir . '/datalib.php';
// Legacy lib with a big-mix of functions.