Completed
Push — master ( ad9227...bd2221 )
by cam
01:15
created
ecrire/inc/invalideur.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	$n = 0;
45 45
 	$time = $GLOBALS['meta']['cache_mark'] ?? 0;
46 46
 	for ($i = 0; $i < 256; $i++) {
47
-		$dir = _DIR_CACHE . sprintf('%02s', dechex($i));
47
+		$dir = _DIR_CACHE.sprintf('%02s', dechex($i));
48 48
 		if (@is_dir($dir) && is_readable($dir) && ($d = opendir($dir))) {
49 49
 			while (($f = readdir($d)) !== false) {
50 50
 				if (preg_match(',^[[0-9a-f]+\.cache$,S', $f) && ($a = stat("$dir/$f"))) {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
 	// stocker la date_modif_$objet (ne sert a rien pour le moment)
103 103
 	if (isset($objet)) {
104
-		ecrire_meta('derniere_modif_' . $objet, time());
104
+		ecrire_meta('derniere_modif_'.$objet, time());
105 105
 	}
106 106
 
107 107
 	// si $derniere_modif_invalide est un array('article', 'rubrique')
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
 	// sur certains sites on veut absolument garder certains caches référencés dans un CDN
146 146
 	// on peut donc inhiber la purge de ces répertoires pour eviter tout probleme
147
-	if (file_exists(rtrim($dir, '/') . '/inhib_purger_repertoire.txt')) {
147
+	if (file_exists(rtrim($dir, '/').'/inhib_purger_repertoire.txt')) {
148 148
 		return 0;
149 149
 	}
150 150
 
Please login to merge, or discard this patch.
ecrire/public/cacher.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 function cache_key(array $contexte, array $page): string {
34 34
 	static $hasher = null;
35 35
 	$hasher ??= new Hash32();
36
-	return $hasher->hash([$contexte, $page]) . '.cache';
36
+	return $hasher->hash([$contexte, $page]).'.cache';
37 37
 }
38 38
 
39 39
 /**
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 		include_spip('inc/acces');
63 63
 		ecrire_meta(
64 64
 			'cache_signature',
65
-			hash('sha256', $_SERVER['DOCUMENT_ROOT'] . ($_SERVER['SERVER_SIGNATURE'] ?? '') . creer_uniqid()),
65
+			hash('sha256', $_SERVER['DOCUMENT_ROOT'].($_SERVER['SERVER_SIGNATURE'] ?? '').creer_uniqid()),
66 66
 			'non'
67 67
 		);
68 68
 	}
69 69
 
70
-	return (new Hash32())->hash($GLOBALS['meta']['cache_signature'] . $page['texte']);
70
+	return (new Hash32())->hash($GLOBALS['meta']['cache_signature'].$page['texte']);
71 71
 }
72 72
 
73 73
 /**
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 		// "cache sessionne" ; sa date indique la date de validite
214 214
 		// des caches sessionnes
215 215
 		if (!$tmp = lire_cache($cache_key)) {
216
-			spip_log('Creation cache sessionne ' . $cache_key);
216
+			spip_log('Creation cache sessionne '.$cache_key);
217 217
 			$tmp = [
218 218
 				'invalideurs' => ['session' => ''],
219 219
 				'lastmodified' => $_SERVER['REQUEST_TIME']
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
 	// l'enregistrer, compresse ou non...
240 240
 	$ok = ecrire_cache($cache_key, $pagez);
241 241
 
242
-	spip_log((_IS_BOT ? 'Bot:' : '') . "Creation du cache $cache_key pour "
243
-		. $page['entetes']['X-Spip-Cache'] . ' secondes' . ($ok ? '' : ' (erreur!)'), _LOG_INFO);
242
+	spip_log((_IS_BOT ? 'Bot:' : '')."Creation du cache $cache_key pour "
243
+		. $page['entetes']['X-Spip-Cache'].' secondes'.($ok ? '' : ' (erreur!)'), _LOG_INFO);
244 244
 
245 245
 	// Inserer ses invalideurs
246 246
 	include_spip('inc/invalideur');
Please login to merge, or discard this patch.