@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | function generer_nom_fichier_cache($contexte, $page) { |
| 30 | 30 | $u = md5(var_export(array($contexte, $page), true)); |
| 31 | 31 | |
| 32 | - return $u . ".cache"; |
|
| 32 | + return $u.".cache"; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | function cache_chemin_fichier($nom_cache, $ecrire = false) { |
| 48 | 48 | static $l1, $l2; |
| 49 | 49 | if (is_null($l1)) { |
| 50 | - $length = (defined('_CACHE_PROFONDEUR_STOCKAGE') ? min(8,max(_CACHE_PROFONDEUR_STOCKAGE,2)) : 4); |
|
| 50 | + $length = (defined('_CACHE_PROFONDEUR_STOCKAGE') ? min(8, max(_CACHE_PROFONDEUR_STOCKAGE, 2)) : 4); |
|
| 51 | 51 | $l1 = intval(floor($length / 2)); |
| 52 | 52 | $l2 = $length - $l1; |
| 53 | 53 | } |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | else { |
| 63 | 63 | // en lecture on essaye pa de creer les repertoires, on va au plus vite |
| 64 | - $rep = _DIR_CACHE . "$d/"; |
|
| 64 | + $rep = _DIR_CACHE."$d/"; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - return $rep . $u . ".cache"; |
|
| 67 | + return $rep.$u.".cache"; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | ), 'non'); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - return crc32($GLOBALS['meta']['cache_signature'] . $page['texte']); |
|
| 114 | + return crc32($GLOBALS['meta']['cache_signature'].$page['texte']); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | // "cache sessionne" ; sa date indique la date de validite |
| 266 | 266 | // des caches sessionnes |
| 267 | 267 | if (!$tmp = lire_cache($chemin_cache)) { |
| 268 | - spip_log('Creation cache sessionne ' . $chemin_cache); |
|
| 268 | + spip_log('Creation cache sessionne '.$chemin_cache); |
|
| 269 | 269 | $tmp = array( |
| 270 | 270 | 'invalideurs' => array('session' => ''), |
| 271 | 271 | 'lastmodified' => $_SERVER['REQUEST_TIME'] |
@@ -289,8 +289,8 @@ discard block |
||
| 289 | 289 | // l'enregistrer, compresse ou non... |
| 290 | 290 | $ok = ecrire_cache($chemin_cache, $pagez); |
| 291 | 291 | |
| 292 | - spip_log((_IS_BOT ? "Bot:" : "") . "Creation du cache $chemin_cache pour " |
|
| 293 | - . $page['entetes']['X-Spip-Cache'] . " secondes" . ($ok ? '' : ' (erreur!)'), _LOG_INFO); |
|
| 292 | + spip_log((_IS_BOT ? "Bot:" : "")."Creation du cache $chemin_cache pour " |
|
| 293 | + . $page['entetes']['X-Spip-Cache']." secondes".($ok ? '' : ' (erreur!)'), _LOG_INFO); |
|
| 294 | 294 | |
| 295 | 295 | // Inserer ses invalideurs |
| 296 | 296 | include_spip('inc/invalideur'); |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | function nettoyer_petit_cache($prefix, $duree = 300) { |
| 313 | 313 | // determiner le repertoire a purger : 'tmp/CACHE/rech/' |
| 314 | 314 | $dircache = sous_repertoire(_DIR_CACHE, $prefix); |
| 315 | - if (spip_touch($dircache . 'purger_' . $prefix, $duree, true)) { |
|
| 315 | + if (spip_touch($dircache.'purger_'.$prefix, $duree, true)) { |
|
| 316 | 316 | foreach (preg_files($dircache, '[.]txt$') as $f) { |
| 317 | 317 | if ($_SERVER['REQUEST_TIME'] - (@file_exists($f) ? @filemtime($f) : 0) > $duree) { |
| 318 | 318 | spip_unlink($f); |
@@ -402,9 +402,9 @@ discard block |
||
| 402 | 402 | if (spip_connect()) { |
| 403 | 403 | include_spip('inc/invalideur'); |
| 404 | 404 | retire_caches($chemin_cache); # API invalideur inutile |
| 405 | - supprimer_fichier(_DIR_CACHE . $chemin_cache); |
|
| 405 | + supprimer_fichier(_DIR_CACHE.$chemin_cache); |
|
| 406 | 406 | if (isset($chemin_cache_session) and $chemin_cache_session) { |
| 407 | - supprimer_fichier(_DIR_CACHE . $chemin_cache_session); |
|
| 407 | + supprimer_fichier(_DIR_CACHE.$chemin_cache_session); |
|
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | } |
@@ -419,9 +419,9 @@ discard block |
||
| 419 | 419 | $page = array('contexte_implicite' => $contexte_implicite); // ignorer le cache deja lu |
| 420 | 420 | include_spip('inc/invalideur'); |
| 421 | 421 | retire_caches($chemin_cache); # API invalideur inutile |
| 422 | - supprimer_fichier(_DIR_CACHE . $chemin_cache); |
|
| 422 | + supprimer_fichier(_DIR_CACHE.$chemin_cache); |
|
| 423 | 423 | if (isset($chemin_cache_session) and $chemin_cache_session) { |
| 424 | - supprimer_fichier(_DIR_CACHE . $chemin_cache_session); |
|
| 424 | + supprimer_fichier(_DIR_CACHE.$chemin_cache_session); |
|
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |