2e6453d8f4dbc36b39936c7db949240d30575d3a
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2013 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
13 if (!defined("_ECRIRE_INC_VERSION")) return;
15 include_spip('engine/textwheel');
16 // si une regle change et rend son cache non valide
17 // incrementer ce define au numero de commit concerne
18 // (inconsistence entre la wheel et l'inclusion php)
19 if (!defined('_WHEELS_VERSION')) define('_WHEELS_VERSION',68672);
22 // Definition des principales wheels de SPIP
24 if (!isset($GLOBALS['spip_wheels'])) {
25 $GLOBALS['spip_wheels'] = array();
28 // Si le tableau des raccourcis existe déjà
29 if (!isset($GLOBALS['spip_wheels']['raccourcis']) OR !is_array($GLOBALS['spip_wheels']['raccourcis']))
30 $GLOBALS['spip_wheels']['raccourcis'] = array(
32 'spip/spip-paragrapher.yaml'
35 $GLOBALS['spip_wheels']['raccourcis'] = array_merge(
38 'spip/spip-paragrapher.yaml'
40 $GLOBALS['spip_wheels']['raccourcis']
43 if (test_espace_prive ())
44 $GLOBALS['spip_wheels']['raccourcis'][] = 'spip/ecrire.yaml';
46 $GLOBALS['spip_wheels']['interdire_scripts'] = array(
47 'spip/interdire-scripts.yaml'
50 $GLOBALS['spip_wheels']['echappe_js'] = array(
51 'spip/echappe-js.yaml'
54 $GLOBALS['spip_wheels']['paragrapher'] = array(
55 'spip/spip-paragrapher.yaml'
58 $GLOBALS['spip_wheels']['listes'] = array(
59 'spip/spip-listes.yaml'
63 // Methode de chargement d'une wheel SPIP
66 class SPIPTextWheelRuleset
extends TextWheelRuleSet
{
67 protected function findFile(&$file, $path=''){
70 // absolute file path?
71 if (file_exists($file))
74 // file include with texwheels, relative to calling ruleset
75 if ($path AND file_exists($f = $path.$file))
78 return find_in_path($file,'wheels/');
81 public static function &loader($ruleset, $callback = '', $class = 'SPIPTextWheelRuleset') {
84 # attention : le ruleset peut contenir apres loading des chemins relatifs
85 # il faut donc que le cache depende du chemin courant vers la racine de SPIP
86 $key = 'tw-'.md5(_WHEELS_VERSION
."-".serialize($ruleset).$callback.$class._DIR_RACINE
);
89 include_spip('inc/memoization');
90 if (!function_exists('cache_get')) include_spip('inc/memoization-mini');
91 if ((!defined('_VAR_MODE') OR _VAR_MODE
!='recalcul')
92 AND $cacheruleset = cache_get($key))
96 $ruleset = parent
::loader($ruleset, $callback, $class);
99 cache_set($key, $ruleset);
106 function tw_trig_purger($quoi){
108 purger_repertoire(_DIR_CACHE
."wheels");