Skip to content
Extraits de code Groupes Projets
Valider 2ef4eed0 rédigé par Fil's avatar Fil
Parcourir les fichiers

ne pas continuer les INCLURE apres qu'on a trouve le fragment qui nous interesse

parent 2996cbf8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
// Distinguer une inclusion d'un appel initial // Distinguer une inclusion d'un appel initial
if (defined('_INC_PUBLIC')) { if (defined('_INC_PUBLIC')) {
// $fond passe par INCLURE(){fond=...} // $fond passe par INCLURE(){fond=...}
if (isset($contexte_inclus['fond'])) if (isset($contexte_inclus['fond']))
$fond = $contexte_inclus['fond']; $fond = $contexte_inclus['fond'];
......
...@@ -186,9 +186,23 @@ function auto_expire($page) ...@@ -186,9 +186,23 @@ function auto_expire($page)
} }
} }
function stop_inclure($fragment) {
if ($fragment == _request('var_fragment')) {
define('_STOP_INCLURE', 1);
#spip_log("fin du fragment $fragment, on arrete d'inclure");
}
}
function inclure_page($fond, $contexte_inclus, $cache_incluant='') { function inclure_page($fond, $contexte_inclus, $cache_incluant='') {
global $lastmodified; global $lastmodified;
// Si un fragment est demande et deja obtenu, inutile de continuer a inclure
if (defined('_STOP_INCLURE')) {
return array(
'texte' => '',
'process_ins' => 'html'
);
}
$fcache = charger_fonction('cacher', 'public'); $fcache = charger_fonction('cacher', 'public');
// Garnir ces quatre parametres avec les infos sur le cache // Garnir ces quatre parametres avec les infos sur le cache
$fcache($contexte_inclus, $use_cache, $chemin_cache, $page, $lastinclude); $fcache($contexte_inclus, $use_cache, $chemin_cache, $page, $lastinclude);
......
...@@ -548,7 +548,7 @@ function compile_cas($tableau, $descr, &$boucles, $id_boucle) { ...@@ -548,7 +548,7 @@ function compile_cas($tableau, $descr, &$boucles, $id_boucle) {
$fragment = $p->fragment; $fragment = $p->fragment;
$fragment .= $nombre_fragments[$p->fragment]++; $fragment .= $nombre_fragments[$p->fragment]++;
$code = "\n((\$f = ($code))? $code = "\n((\$f = ($code))?
'<div id=\"$fragment\" class=\"fragment\">'.\$f.'<!-- /$fragment --></div>':'')\n"; '<div id=\"$fragment\" class=\"fragment\">'.\$f.'<!-- /$fragment --></div><"."?php stop_inclure(\"$fragment\"); ?".">':'')\n";
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter