Changeset 112183 in spip-zone
- Timestamp:
- Oct 27, 2018, 8:13:02 PM (2 years ago)
- Location:
- _plugins_/cachelab/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/cachelab/trunk/inc/cachelab.php
r112182 r112183 72 72 } 73 73 74 // pour 'contexte' on simule un 'more' pour donner un exemple d'extension 75 if (isset($conditions['contexte']) and $conditions['contexte'] and !isset($conditions['more'])) 76 $conditions['more'] = 'contexte'; 77 if ($more = (isset($conditions['more']) ? (string)$conditions['more'] : '')) { 78 $morefunc='cachelab_filtrecache_'.$more; 79 // Signature nécessaire : $morefunc ($action, $conditions, $options, &$stats) 80 if (!function_exists($morefunc)) { 81 spip_log ("La fonction '$morefunc' n'est pas définie", 'cachelab_erreur'); 74 if (isset($conditions['more'])) // obsolète (todo : fix vieux codes appelant) 75 $conditions['plus'] = $conditions['more']; 76 // pour 'contexte' on simule un 'plus' pour donner un exemple d'extension 77 if (isset($conditions['contexte']) and $conditions['contexte'] and !isset($conditions['plus'])) 78 $conditions['plus'] = 'contexte'; 79 if ($plus = (isset($conditions['plus']) ? (string)$conditions['plus'] : '')) { 80 $plusfunc='cachelab_filtrecache_'.$plus; 81 // Signature nécessaire : $plusfunc ($action, $conditions, $options, &$stats) 82 if (!function_exists($plusfunc)) { 83 spip_log ("La fonction '$plusfunc' n'est pas définie", 'cachelab_erreur'); 82 84 return; 83 85 } … … 186 188 187 189 // pour les filtres suivants on a besoin du contenu du cache 188 if ($cle_objet or $ morefunc) {190 if ($cle_objet or $plusfunc) { 189 191 global $Memoization; 190 192 $data = $Memoization->get(substr($cle, $len_prefix)); … … 209 211 210 212 // 4eme filtre : par une extension 211 if ($ morefunc212 and !$ morefunc ($action, $conditions, $options, $cle, $data, $stats))213 if ($plusfunc 214 and !$plusfunc ($action, $conditions, $options, $cle, $data, $stats)) 213 215 continue; 214 216 … … 248 250 249 251 // 250 // Exemple d'extension utilisable avec ' more'=>'contexte'252 // Exemple d'extension utilisable avec 'plus'=>'contexte' 251 253 // Filtrer non sur une seule valeur de l'environnement comme avec 'cle_objet' 252 254 // mais sur un ensemble de valeurs spécifié par $conditions['contexte'] -
_plugins_/cachelab/trunk/paquet.xml
r112171 r112183 2 2 prefix="cachelab" 3 3 categorie="outil" 4 version="0. 3.1"4 version="0.4.0" 5 5 etat="dev" 6 6 compatibilite="[3.0.0;3.2.*]"
Note: See TracChangeset
for help on using the changeset viewer.