Changeset 16761 for _plugins_/_dev_/expresso
- Timestamp:
- 11/11/07 12:14:05 (2 years ago)
- Files:
-
- 1 modified
-
_plugins_/_dev_/expresso/expresso_pipeline.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_dev_/expresso/expresso_pipeline.php
r16750 r16761 89 89 } 90 90 91 function expresso_append_url($url,$cachefile){ 92 $GLOBALS['meta']['expresso'] .= "$url!$cachefile\n"; 93 expresso_genere_htaccess(); 94 } 95 function expresso_remove_url($url,$cachefile){ 96 $GLOBALS['meta']['expresso'] = preg_replace(",$url!.*?\n,","",$GLOBALS['meta']['expresso']); 97 expresso_genere_htaccess(); 98 @unlink($cachefile); 99 } 100 91 101 function expresso_affichage_final($flux) { 102 $url = self(true); 103 $url = "http://".$_SERVER['HTTP_HOST']. preg_replace(';^[a-z]{3,5}://[^/]*;','',$GLOBALS['meta']['adresse_site']) . $url; 92 104 if (empty($_POST) 93 105 AND !isset($_COOKIE['spip_admin']) 94 106 AND !isset($_COOKIE['spip_session']) 95 107 AND !isset($_SERVER['PHP_AUTH_USER'])){ 96 $url = self(true);97 $url = "http://".$_SERVER['HTTP_HOST']. preg_replace(';^[a-z]{3,5}://[^/]*;','',$GLOBALS['meta']['adresse_site']) . $url;98 108 if (isset($GLOBALS['page']['entetes']['X-Expresso'])) { 99 109 $nom_cache = _DIR_VAR . "apache/".md5($url).".html"; … … 101 111 ($GLOBALS['var_mode']=='calcul') 102 112 OR ($GLOBALS['var_mode']=='recalcul') 103 OR !( $e=file_exists($nom_cache))113 OR !(file_exists($nom_cache)) 104 114 OR ( ($d=filemtime($nom_cache)) AND ($d+$GLOBALS['page']['entetes']['X-Spip-Cache']<time())) 105 115 ) { … … 108 118 # expresso est une simple chaine pour eviter la deserialisation a chaque hit et preferer un strpos plus rapide 109 119 # url!nom_cache\n 110 if (strpos($GLOBALS['meta']['expresso'],"$url!")===FALSE) { 111 $GLOBALS['meta']['expresso'] .= "$url!$nom_cache\n"; 112 expresso_genere_htaccess(); 113 } 120 if (strpos($GLOBALS['meta']['expresso'],"$url!")===FALSE) 121 expresso_append_url($url,$nom_cache); 114 122 elseif($GLOBALS['var_mode']=='recalcul') 115 123 expresso_genere_htaccess(); 116 124 } 117 125 } 118 elseif (strpos($GLOBALS['meta']['expresso'],"$url!")!==FALSE) { 119 $GLOBALS['meta']['expresso'] = preg_replace(",$url!.*?\n,","",$GLOBALS['meta']['expresso']); 120 expresso_genere_htaccess(); 121 } 126 elseif (strpos($GLOBALS['meta']['expresso'],"$url!")!==FALSE) 127 expresso_remove_url($url,$nom_cache); 128 } 129 else { 130 if ( 131 isset($_COOKIE['spip_admin']) 132 && 133 ( ($GLOBALS['var_mode']=='calcul') OR ($GLOBALS['var_mode']=='recalcul')) 134 ) { 135 $nom_cache = _DIR_VAR . "apache/".md5($url).".html"; 136 if (file_exists($nom_cache)) 137 expresso_remove_url($url,$nom_cache); 138 } 122 139 } 123 140 return $flux;
