Ci-dessous, les différences entre deux révisions de la page.
— |
notes_relatives_a_la_mise_en_oeuvre_de_certaines_librairies_locales [2016/07/19 14:33] (Version actuelle) admin créée |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ===== Notes relatives à la mise en oeuvre de certaines librairies locales ===== | ||
+ | Certaines librairies locales peuvent proposer des fonction qui doivent être utilisées AVANT que moodle ne monte son système interne de librairies. | ||
+ | |||
+ | Dans ce cas, il est conseillé d'inclure dans le fichier config.php, à une position relativement précoce, un appel d'inclusion à un chargeur anticipé de librairies : | ||
+ | |||
+ | require '/path/to/moodle/local/libloader.php'; | ||
+ | |||
+ | Le fichier local/libloader.php contient des appels non bloquants à des librairies susceptibles d'aovir cette exigence : | ||
+ | |||
+ | define('MOODLE_EARLY_INTERNAL', true); | ||
+ | |||
+ | if (file_exists($CFG->dirroot.'/local/lib.php')) { | ||
+ | include_once($CFG->dirroot.'/local/lib.php'); // generic local functions | ||
+ | } | ||
+ | if (file_exists($CFG->dirroot.'/local/technicalsignals/lib.php')) { | ||
+ | include_once($CFG->dirroot.'/local/technicalsignals/lib.php'); | ||
+ | } | ||
+ | if (file_exists($CFG->dirroot.'/local/staticguitexts/lib.php')) { | ||
+ | include_once($CFG->dirroot.'/local/staticguitexts/lib.php'); | ||
+ | } | ||
+ | if (file_exists($CFG->dirroot.'/local/advancedperfs/debugtools.php')) { | ||
+ | include_once($CFG->dirroot.'/local/advancedperfs/debugtools.php'); | ||
+ | } | ||
+ | if (file_exists($CFG->dirroot.'/local/advancedperfs/perflib.php')) { | ||
+ | include_once($CFG->dirroot.'/local/advancedperfs/perflib.php'); | ||
+ | } | ||
+ | if (file_exists($CFG->dirroot.'/local/multiroot/lib.php')) { | ||
+ | include_once($CFG->dirroot.'/local/multiroot/lib.php'); | ||
+ | } | ||
+ | if (!defined('CLI_SCRIPT')) { | ||
+ | if (file_exists($CFG->dirroot.'/local/my/lib.php')) { | ||
+ | include_once($CFG->dirroot.'/local/my/lib.php'); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | La définition de MOODLE_ENRALY_INTERNAL permet d'activer ces librairies si elles sont en effet chargées avant l'intervention du 'setup.php' dans le fichier de configuration principal de Moodle. | ||
+ | |||
+ | Si ces librairies peuvent être invoquées après ce dernier, alors la définition standard MOODLE_INTERNAL s'applique. | ||
+ | |||
+ | [[:start|Retour au catalogue]] |