Completed
Push — master ( fdca64...241762 )
by cam
02:05
created
ecrire/bootstrap/inc/i18n.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 					$value = interdire_scripts($value, -1);
130 130
 				}
131 131
 				if (!empty($options['class'])) {
132
-					$value = "<span class='" . $options['class'] . "'>$value</span>";
132
+					$value = "<span class='".$options['class']."'>$value</span>";
133 133
 				}
134 134
 				$text = str_replace("@$name@", (string) $value, (string) $text);
135 135
 				unset($args[$name]);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		// Si des variables n'ont pas ete inserees, le signaler
139 139
 		// (chaines de langues pas a jour)
140 140
 		if ($args) {
141
-			spip_logger()->debug("$f:  variables inutilisees " . join(', ', array_keys($args)));
141
+			spip_logger()->debug("$f:  variables inutilisees ".join(', ', array_keys($args)));
142 142
 		}
143 143
 	}
144 144
 
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/loading.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
 	if (strlen($dossier) && !str_ends_with($dossier, '/')) {
33 33
 		$dossier .= '/';
34 34
 	}
35
-	$f = str_replace('/', '_', $dossier) . $nom;
35
+	$f = str_replace('/', '_', $dossier).$nom;
36 36
 
37 37
 	if (function_exists($f)) {
38 38
 		return $f;
39 39
 	}
40
-	if (function_exists($g = $f . '_dist')) {
40
+	if (function_exists($g = $f.'_dist')) {
41 41
 		return $g;
42 42
 	}
43 43
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	// passer en minuscules (cf les balises de formulaires)
59 59
 	// et inclure le fichier
60 60
 	if (
61
-		!($inc = include_spip($dossier . ($d = strtolower($nom))))
61
+		!($inc = include_spip($dossier.($d = strtolower($nom))))
62 62
 		&& strlen(dirname($dossier))
63 63
 		&& dirname($dossier) != '.'
64 64
 	) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	}
77 77
 
78 78
 	// Echec : message d'erreur
79
-	spip_logger()->info("fonction $nom ($f ou $g) indisponible" .
79
+	spip_logger()->info("fonction $nom ($f ou $g) indisponible".
80 80
 		($inc ? '' : " (fichier $d absent de $dossier)"));
81 81
 
82 82
 	include_spip('inc/minipres');
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
 	echo minipres(
85 85
 		_T('forum_titre_erreur'),
86 86
 		$inc ?
87
-			_T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>'])
87
+			_T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>'])
88 88
 			. '<br />'
89
-			. _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>'])
89
+			. _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>'])
90 90
 			:
91
-			_T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']),
92
-		['all_inline' => true,'status' => 404]
91
+			_T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']),
92
+		['all_inline' => true, 'status' => 404]
93 93
 	);
94 94
 	exit;
95 95
 }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
  *     - string : chemin du fichier trouvé
136 136
  **/
137 137
 function include_spip($f, $include = true) {
138
-	return find_in_path($f . '.php', '', $include);
138
+	return find_in_path($f.'.php', '', $include);
139 139
 }
140 140
 
141 141
 /**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
  *     - string : chemin du fichier trouvé
156 156
  **/
157 157
 function require_spip($f) {
158
-	return find_in_path($f . '.php', '', 'required');
158
+	return find_in_path($f.'.php', '', 'required');
159 159
 }
160 160
 
161 161
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		// donc il faut l'inclure "en globals"
174 174
 		if ($f = find_in_path('mes_fonctions.php')) {
175 175
 			global $dossier_squelettes;
176
-			include_once(_ROOT_CWD . $f);
176
+			include_once(_ROOT_CWD.$f);
177 177
 		}
178 178
 
179 179
 		if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
 	if ($type === 'defaut') {
202 202
 		$objet = objet_type($quoi);
203 203
 		if (
204
-			($f = charger_fonction('generer_' . $objet . '_url', 'urls', true))
205
-			|| ($f = charger_fonction('generer_url_' . $objet, 'urls', true)) // deprecated
204
+			($f = charger_fonction('generer_'.$objet.'_url', 'urls', true))
205
+			|| ($f = charger_fonction('generer_url_'.$objet, 'urls', true)) // deprecated
206 206
 		) {
207 207
 			return $f;
208 208
 		}
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	}
216 216
 
217 217
 	// inclure le module d'url
218
-	include_spip('urls/' . $url_type);
218
+	include_spip('urls/'.$url_type);
219 219
 
220 220
 	switch ($quoi) {
221 221
 		case 'page':
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
  * @return array|string
278 278
  */
279 279
 function trouver_fond($nom, $dir = '', $pathinfo = false) {
280
-	$f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : '');
280
+	$f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : '');
281 281
 	if (!$pathinfo) {
282 282
 		return $f;
283 283
 	}
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/initialization.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
 
40 40
 	// le nom du repertoire plugins/ activables/desactivables
41 41
 	if (!defined('_DIR_PLUGINS')) {
42
-		define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/');
42
+		define('_DIR_PLUGINS', _DIR_RACINE.'plugins/');
43 43
 	}
44 44
 
45 45
 	// le nom du repertoire des extensions/ permanentes du core, toujours actives
46 46
 	if (!defined('_DIR_PLUGINS_DIST')) {
47
-		define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/');
47
+		define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/');
48 48
 	}
49 49
 
50 50
 	// le nom du repertoire des librairies
51 51
 	if (!defined('_DIR_LIB')) {
52
-		define('_DIR_LIB', _DIR_RACINE . 'lib/');
52
+		define('_DIR_LIB', _DIR_RACINE.'lib/');
53 53
 	}
54 54
 
55 55
 	// répertoire des libs via Composer
56 56
 	if (!defined('_DIR_VENDOR')) {
57
-		define('_DIR_VENDOR', _DIR_RACINE . 'vendor/');
57
+		define('_DIR_VENDOR', _DIR_RACINE.'vendor/');
58 58
 	}
59 59
 
60 60
 	if (!defined('_DIR_IMG')) {
@@ -64,29 +64,29 @@  discard block
 block discarded – undo
64 64
 		define('_DIR_LOGOS', $pa);
65 65
 	}
66 66
 	if (!defined('_DIR_IMG_ICONES')) {
67
-		define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/');
67
+		define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/');
68 68
 	}
69 69
 
70 70
 	if (!defined('_DIR_DUMP')) {
71
-		define('_DIR_DUMP', $ti . 'dump/');
71
+		define('_DIR_DUMP', $ti.'dump/');
72 72
 	}
73 73
 	if (!defined('_DIR_SESSIONS')) {
74
-		define('_DIR_SESSIONS', $ti . 'sessions/');
74
+		define('_DIR_SESSIONS', $ti.'sessions/');
75 75
 	}
76 76
 	if (!defined('_DIR_TRANSFERT')) {
77
-		define('_DIR_TRANSFERT', $ti . 'upload/');
77
+		define('_DIR_TRANSFERT', $ti.'upload/');
78 78
 	}
79 79
 	if (!defined('_DIR_CACHE')) {
80
-		define('_DIR_CACHE', $ti . 'cache/');
80
+		define('_DIR_CACHE', $ti.'cache/');
81 81
 	}
82 82
 	if (!defined('_DIR_CACHE_XML')) {
83
-		define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/');
83
+		define('_DIR_CACHE_XML', _DIR_CACHE.'xml/');
84 84
 	}
85 85
 	if (!defined('_DIR_SKELS')) {
86
-		define('_DIR_SKELS', _DIR_CACHE . 'skel/');
86
+		define('_DIR_SKELS', _DIR_CACHE.'skel/');
87 87
 	}
88 88
 	if (!defined('_DIR_AIDE')) {
89
-		define('_DIR_AIDE', _DIR_CACHE . 'aide/');
89
+		define('_DIR_AIDE', _DIR_CACHE.'aide/');
90 90
 	}
91 91
 	if (!defined('_DIR_TMP')) {
92 92
 		define('_DIR_TMP', $ti);
@@ -115,27 +115,27 @@  discard block
 block discarded – undo
115 115
 	// Declaration des fichiers
116 116
 
117 117
 	if (!defined('_CACHE_PLUGINS_PATH')) {
118
-		define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php');
118
+		define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php');
119 119
 	}
120 120
 	if (!defined('_CACHE_PLUGINS_OPT')) {
121
-		define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php');
121
+		define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php');
122 122
 	}
123 123
 	if (!defined('_CACHE_PLUGINS_FCT')) {
124
-		define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php');
124
+		define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php');
125 125
 	}
126 126
 	if (!defined('_CACHE_PIPELINES')) {
127
-		define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php');
127
+		define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php');
128 128
 	}
129 129
 	if (!defined('_CACHE_CHEMIN')) {
130
-		define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt');
130
+		define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt');
131 131
 	}
132 132
 
133 133
 	# attention .php obligatoire pour ecrire_fichier_securise
134 134
 	if (!defined('_FILE_META')) {
135
-		define('_FILE_META', $ti . 'meta_cache.php');
135
+		define('_FILE_META', $ti.'meta_cache.php');
136 136
 	}
137 137
 	if (!defined('_DIR_LOG')) {
138
-		define('_DIR_LOG', _DIR_TMP . 'log/');
138
+		define('_DIR_LOG', _DIR_TMP.'log/');
139 139
 	}
140 140
 	if (!defined('_FILE_LOG')) {
141 141
 		define('_FILE_LOG', 'spip');
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	if (!defined('_FILE_CONNECT')) {
152 152
 		define(
153 153
 			'_FILE_CONNECT',
154
-			@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f : false
154
+			@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f : false
155 155
 		);
156 156
 	}
157 157
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	if (!defined('_FILE_CHMOD')) {
163 163
 		define(
164 164
 			'_FILE_CHMOD',
165
-			@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f : false
165
+			@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f : false
166 166
 		);
167 167
 	}
168 168
 
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 		define('_FILE_TMP_SUFFIX', '.tmp.php');
175 175
 	}
176 176
 	if (!defined('_FILE_CONNECT_TMP')) {
177
-		define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX);
177
+		define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX);
178 178
 	}
179 179
 	if (!defined('_FILE_CHMOD_TMP')) {
180
-		define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX);
180
+		define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX);
181 181
 	}
182 182
 
183 183
 	// Definition des droits d'acces en ecriture
@@ -195,13 +195,13 @@  discard block
 block discarded – undo
195 195
 		define('_DEFAULT_CHARSET', 'utf-8');
196 196
 	}
197 197
 	if (!defined('_ROOT_PLUGINS')) {
198
-		define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins' . DIRECTORY_SEPARATOR);
198
+		define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins'.DIRECTORY_SEPARATOR);
199 199
 	}
200 200
 	if (!defined('_ROOT_PLUGINS_DIST')) {
201
-		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist' . DIRECTORY_SEPARATOR);
201
+		define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist'.DIRECTORY_SEPARATOR);
202 202
 	}
203 203
 	if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) {
204
-		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
204
+		define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL));
205 205
 	}
206 206
 
207 207
 	// La taille des Log
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 	// (non surchargeable en l'etat ; attention si on utilise include_spip()
239 239
 	// pour le rendre surchargeable, on va provoquer un reecriture
240 240
 	// systematique du noyau ou une baisse de perfs => a etudier)
241
-	include_once _ROOT_RESTREINT . 'inc/flock.php';
241
+	include_once _ROOT_RESTREINT.'inc/flock.php';
242 242
 
243 243
 	// charger le path des plugins
244 244
 	if (@is_readable(_CACHE_PLUGINS_PATH)) {
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			!empty($_SERVER['QUERY_STRING'])
277 277
 			&& !strpos($_SERVER['REQUEST_URI'], '?')
278 278
 		) {
279
-			$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
279
+			$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
280 280
 		}
281 281
 	}
282 282
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 		) {
313 313
 			if (isset($GLOBALS['meta']['adresse_site'])) {
314 314
 				$uri_ref = parse_url($GLOBALS['meta']['adresse_site']);
315
-				$uri_ref = ($uri_ref['path'] ?? '') . '/';
315
+				$uri_ref = ($uri_ref['path'] ?? '').'/';
316 316
 			} else {
317 317
 				$uri_ref = '';
318 318
 			}
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	}
407 407
 	if (!defined('_CACHE_RUBRIQUES')) {
408 408
 		/** Fichier cache pour le navigateur de rubrique du bandeau */
409
-		define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt');
409
+		define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt');
410 410
 	}
411 411
 	if (!defined('_CACHE_RUBRIQUES_MAX')) {
412 412
 		/** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 						define('_VAR_MODE', reset($var_mode));
629 629
 					}
630 630
 					if (isset($GLOBALS['visiteur_session']['nom'])) {
631
-						spip_logger()->info($GLOBALS['visiteur_session']['nom'] . ' ' . _VAR_MODE);
631
+						spip_logger()->info($GLOBALS['visiteur_session']['nom'].' '._VAR_MODE);
632 632
 					}
633 633
 				} // pas autorise ?
634 634
 				else {
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 						if (!str_contains($self, 'page=login')) {
644 644
 							include_spip('inc/headers');
645 645
 							$redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&');
646
-							redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true));
646
+							redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true));
647 647
 						}
648 648
 					}
649 649
 					// sinon tant pis
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/pipeline.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
 	}
92 92
 
93 93
 	// appliquer notre fonction si elle existe
94
-	$fonc = 'execute_pipeline_' . strtolower($action);
94
+	$fonc = 'execute_pipeline_'.strtolower($action);
95 95
 	if (function_exists($fonc)) {
96 96
 		$val = $fonc($val);
97 97
 	} else {
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/path.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @param null|array $add List of «plugins» directories to add
14 14
  */
15 15
 function spip_paths(
16
-	null|array $add = null,
16
+	null | array $add = null,
17 17
 ): AggregatorInterface {
18 18
 	static $paths = null;
19 19
 	static $last_dossier_squelettes = null;
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
 		$paths = new GroupAggregator(Group::cases(), _ROOT_CWD);
25 25
 		$paths = $paths->with(Group::App, [
26 26
 			_DIR_RACINE,
27
-			_DIR_RACINE . 'squelettes-dist/',
28
-			_DIR_RACINE . 'prive/',
27
+			_DIR_RACINE.'squelettes-dist/',
28
+			_DIR_RACINE.'prive/',
29 29
 			_DIR_RESTREINT,
30 30
 		]);
31 31
 
32
-		if (@is_dir(_DIR_RACINE . 'squelettes')) {
33
-			$paths = $paths->with(Group::Templates, [_DIR_RACINE . 'squelettes']);
32
+		if (@is_dir(_DIR_RACINE.'squelettes')) {
33
+			$paths = $paths->with(Group::Templates, [_DIR_RACINE.'squelettes']);
34 34
 		}
35 35
 	}
36 36
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$ds = explode(':', $dossier_squelettes);
45 45
 			foreach ($ds as $key => $directory) {
46 46
 				if (!str_starts_with($directory, '/')) {
47
-					$ds[$key] = _DIR_RACINE . $directory;
47
+					$ds[$key] = _DIR_RACINE.$directory;
48 48
 				}
49 49
 			}
50 50
 			$paths = $paths->with(Group::ExtraTemplates, $ds);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
  * @return array
102 102
  *     Liste des chemins, par ordre de priorité.
103 103
  **/
104
-function _chemin(string|array|null $dir_path = null): array {
104
+function _chemin(string | array | null $dir_path = null): array {
105 105
 	if (is_array($dir_path) || (is_string($dir_path) && strlen($dir_path))) {
106 106
 		spip_paths(add: is_array($dir_path) ? $dir_path : explode(':', $dir_path));
107 107
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 function creer_chemin(): array {
118 118
 	$dirs = spip_paths()->getDirectories();
119 119
 	// canal historique: avec / sauf si ''
120
-	return array_map(fn ($dir) => $dir === '' ? $dir : $dir . DIRECTORY_SEPARATOR, $dirs);
120
+	return array_map(fn ($dir) => $dir === '' ? $dir : $dir.DIRECTORY_SEPARATOR, $dirs);
121 121
 }
122 122
 
123 123
 /**
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 	// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
164 164
 	if (
165 165
 		preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m)
166
-		&& ($file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg')
166
+		&& ($file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg')
167 167
 		&& ($f = find_in_theme("$file_svg_generique"))
168 168
 	) {
169
-		if (($fsize = substr($f, 0, -6) . $m[1] . '.svg') && file_exists($fsize)) {
169
+		if (($fsize = substr($f, 0, -6).$m[1].'.svg') && file_exists($fsize)) {
170 170
 			return $themefiles["$subdir$file"] = $fsize;
171 171
 		}
172 172
 		else {
173
-			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
173
+			return $themefiles["$subdir$file"] = "$f?".$m[1].'px';
174 174
 		}
175 175
 	}
176 176
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			return $themefiles["$subdir$file"] = $f;
181 181
 		}
182 182
 	}
183
-	spip_logger('theme')->info("$file introuvable dans le theme prive " . reset($themes));
183
+	spip_logger('theme')->info("$file introuvable dans le theme prive ".reset($themes));
184 184
 
185 185
 	return $themefiles["$subdir$file"] = '';
186 186
 }
@@ -260,18 +260,18 @@  discard block
 block discarded – undo
260 260
  *     - string : chemin du fichier trouvé
261 261
  *     - false : fichier introuvable
262 262
  **/
263
-function find_in_path(string $file, string $dirname = '', bool|string $include = false): ?string {
263
+function find_in_path(string $file, string $dirname = '', bool | string $include = false): ?string {
264 264
 
265 265
 	$loader = spip_paths_loader();
266 266
 
267 267
 	if ($dirname) {
268
-		$file = rtrim($dirname, '/') . '/' . $file;
268
+		$file = rtrim($dirname, '/').'/'.$file;
269 269
 	}
270 270
 
271 271
 	$path = $loader->get($file);
272 272
 	// find in path retourne des chemins relatif, si possible
273 273
 	if ($path !== null && str_starts_with($path, _ROOT_RACINE)) {
274
-		$path = _DIR_RACINE . substr($path, strlen(_ROOT_RACINE));
274
+		$path = _DIR_RACINE.substr($path, strlen(_ROOT_RACINE));
275 275
 	}
276 276
 
277 277
 	if ($include === false) {
@@ -326,12 +326,12 @@  discard block
 block discarded – undo
326 326
 	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
327 327
 	// on a pas encore inclus flock.php
328 328
 	if (!function_exists('preg_files')) {
329
-		include_once _ROOT_RESTREINT . 'inc/flock.php';
329
+		include_once _ROOT_RESTREINT.'inc/flock.php';
330 330
 	}
331 331
 
332 332
 	// Parcourir le chemin
333 333
 	foreach (creer_chemin() as $d) {
334
-		$f = $d . $dir;
334
+		$f = $d.$dir;
335 335
 		if (@is_dir($f)) {
336 336
 			$liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs);
337 337
 			foreach ($liste as $chemin) {
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/jobs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
 
145 145
 	if ($queue_next_job_time == -1) {
146 146
 		if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) {
147
-			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt');
147
+			define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt');
148 148
 		}
149 149
 		// utiliser un cache memoire si dispo
150 150
 		if (function_exists('cache_get') && defined('_MEMOIZE_MEMORY') && _MEMOIZE_MEMORY) {
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/logging.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 	if ($loggerFactory === null) {
37 37
 		$spipToMonologLevels = [
38 38
 			Level::Emergency, // _LOG_HS
39
-			Level::Alert,     // _LOG_ALERTE_ROUGE
40
-			Level::Critical,  // _LOG_CRITIQUE
41
-			Level::Error,     // _LOG_ERREUR
42
-			Level::Warning,   // _LOG_AVERTISSEMENT
43
-			Level::Notice,    // _LOG_INFO_IMPORTANTE
44
-			Level::Info,      // _LOG_INFO
45
-			Level::Debug,     // _LOG_DEBUG
39
+			Level::Alert, // _LOG_ALERTE_ROUGE
40
+			Level::Critical, // _LOG_CRITIQUE
41
+			Level::Error, // _LOG_ERREUR
42
+			Level::Warning, // _LOG_AVERTISSEMENT
43
+			Level::Notice, // _LOG_INFO_IMPORTANTE
44
+			Level::Info, // _LOG_INFO
45
+			Level::Debug, // _LOG_DEBUG
46 46
 		];
47 47
 
48 48
 		$config = [
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 			// échappement des log
56 56
 			'brut' => defined('_LOG_BRUT') ? constant('_LOG_BRUT') : null,
57 57
 			// à quel level on commence à logguer
58
-			'max_level' => (function() use ($spipToMonologLevels): Level {
58
+			'max_level' => (function() use ($spipToMonologLevels) : Level {
59 59
 				if (!defined('_LOG_FILTRE_GRAVITE')) {
60 60
 					return Level::Notice;
61 61
 				}
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
 {
137 137
     static $spipToMonologLevels = [
138 138
 		Level::Emergency, // _LOG_HS
139
-		Level::Alert,     // _LOG_ALERTE_ROUGE
140
-		Level::Critical,  // _LOG_CRITIQUE
141
-		Level::Error,     // _LOG_ERREUR
142
-		Level::Warning,   // _LOG_AVERTISSEMENT
143
-		Level::Notice,    // _LOG_INFO_IMPORTANTE
144
-		Level::Info,      // _LOG_INFO
145
-		Level::Debug,     // _LOG_DEBUG
139
+		Level::Alert, // _LOG_ALERTE_ROUGE
140
+		Level::Critical, // _LOG_CRITIQUE
141
+		Level::Error, // _LOG_ERREUR
142
+		Level::Warning, // _LOG_AVERTISSEMENT
143
+		Level::Notice, // _LOG_INFO_IMPORTANTE
144
+		Level::Info, // _LOG_INFO
145
+		Level::Debug, // _LOG_DEBUG
146 146
     ];
147 147
 
148 148
 	# Éviter de trop polluer les logs de dépréciation
Please login to merge, or discard this patch.
ecrire/bootstrap/inc/urls.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	foreach ($regexp as $r => $e) {
86 86
 		$regexp[$r] = str_replace('[]', '\[\]', preg_replace(',[^\w\d\[\]-],', '', $e));
87 87
 	}
88
-	$regexp = ',^(' . implode('|', $regexp) . '[[]?[]]?)(=.*)?$,';
88
+	$regexp = ',^('.implode('|', $regexp).'[[]?[]]?)(=.*)?$,';
89 89
 	$ajouts = array_flip(explode('|', $c));
90 90
 	$u = is_array($v) ? $v : rawurlencode((string) $v);
91 91
 	$testv = (is_array($v) ? count($v) : strlen((string) $v));
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			// Ajout. Pour une variable, remplacer au meme endroit,
113 113
 			// pour un tableau ce sera fait dans la prochaine boucle
114 114
 			elseif (!str_ends_with($r[1], '[]')) {
115
-				$url[$n] = $r[1] . '=' . $u;
115
+				$url[$n] = $r[1].'='.$u;
116 116
 				unset($ajouts[$r[1]]);
117 117
 			}
118 118
 			// Pour les tableaux on laisse tomber les valeurs de
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
 	} elseif ($testv) {
134 134
 		foreach ($ajouts as $k => $n) {
135 135
 			if (!is_array($v)) {
136
-				$url[] = $k . '=' . $u;
136
+				$url[] = $k.'='.$u;
137 137
 			} else {
138
-				$id = (str_ends_with($k, '[]')) ? $k : ($k . '[]');
138
+				$id = (str_ends_with($k, '[]')) ? $k : ($k.'[]');
139 139
 				foreach ($v as $w) {
140
-					$url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w));
140
+					$url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w));
141 141
 				}
142 142
 			}
143 143
 		}
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
 
149 149
 	// recomposer l'adresse
150 150
 	if ($url) {
151
-		$a .= '?' . join($sep, $url);
151
+		$a .= '?'.join($sep, $url);
152 152
 	}
153 153
 
154
-	return $a . $ancre;
154
+	return $a.$ancre;
155 155
 }
156 156
 
157 157
 /**
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 			translitteration($ancre)
182 182
 		);
183 183
 	}
184
-	return $url . (strlen($ancre) ? '#' . $ancre : '');
184
+	return $url.(strlen($ancre) ? '#'.$ancre : '');
185 185
 }
186 186
 
187 187
 /**
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			if (str_starts_with($var, '^')) {
227 227
 				$var = substr($var, 1);
228 228
 			} else {
229
-				$var = '[^=&]*' . $var;
229
+				$var = '[^=&]*'.$var;
230 230
 			}
231 231
 			if (str_ends_with($var, '$')) {
232 232
 				$var = substr($var, 0, -1);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 				$var .= '[^=&]*';
235 235
 			}
236 236
 		}
237
-		$preg_nettoyer = ',([?&])(' . implode('|', $preg_nettoyer_vars) . ')=[^&]*(&|$),i';
237
+		$preg_nettoyer = ',([?&])('.implode('|', $preg_nettoyer_vars).')=[^&]*(&|$),i';
238 238
 	}
239 239
 	if (empty($request_uri)) {
240 240
 		return $request_uri;
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	}
365 365
 
366 366
 	// On a ete gentil mais la ....
367
-	spip_logger()->error("generer_objet_url: entite $entite " . ($public ? "($f)" : '') . " inconnue $type $public $connect");
367
+	spip_logger()->error("generer_objet_url: entite $entite ".($public ? "($f)" : '')." inconnue $type $public $connect");
368 368
 
369 369
 	return '';
370 370
 }
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
 	include_spip('base/connect_sql');
416 416
 	$id_type = id_table_objet($entite, $public);
417 417
 
418
-	return _DIR_RACINE . get_spip_script('./')
419
-	. '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public"
418
+	return _DIR_RACINE.get_spip_script('./')
419
+	. '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public"
420 420
 	. (!$args ? '' : "&$args")
421 421
 	. (!$ancre ? '' : "#$ancre");
422 422
 }
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 				!empty($_SERVER['QUERY_STRING'])
567 567
 				&& !str_contains($_SERVER['REQUEST_URI'], '?')
568 568
 			) {
569
-				$GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
569
+				$GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
570 570
 			}
571 571
 		}
572 572
 	}
@@ -604,9 +604,9 @@  discard block
 block discarded – undo
604 604
 		array_shift($myself);
605 605
 		$myself = implode('/', $myself);
606 606
 	}
607
-	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/';
607
+	$url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/';
608 608
 
609
-	$url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/');
609
+	$url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/');
610 610
 
611 611
 	return $url;
612 612
 }
@@ -645,16 +645,16 @@  discard block
 block discarded – undo
645 645
 function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) {
646 646
 	$script ??= '';
647 647
 	if (!$rel) {
648
-		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
648
+		$rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT;
649 649
 	} else {
650 650
 		if (!is_string($rel)) {
651
-			$rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT;
651
+			$rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT;
652 652
 		}
653 653
 	}
654 654
 
655 655
 	[$script, $ancre] = array_pad(explode('#', $script), 2, null);
656 656
 	if ($script && ($script <> 'accueil' || $rel)) {
657
-		$args = "?exec=$script" . (!$args ? '' : "&$args");
657
+		$args = "?exec=$script".(!$args ? '' : "&$args");
658 658
 	} elseif ($args) {
659 659
 		$args = "?$args";
660 660
 	}
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 		$args .= "#$ancre";
663 663
 	}
664 664
 
665
-	return $rel . ($no_entities ? $args : str_replace('&', '&amp;', $args));
665
+	return $rel.($no_entities ? $args : str_replace('&', '&amp;', $args));
666 666
 }
667 667
 
668 668
 //
@@ -744,10 +744,10 @@  discard block
 block discarded – undo
744 744
 			$action = parametre_url($action, _SPIP_PAGE, $script, '&');
745 745
 		}
746 746
 		if ($args) {
747
-			$action .= (str_contains($action, '?') ? '&' : '?') . $args;
747
+			$action .= (str_contains($action, '?') ? '&' : '?').$args;
748 748
 		}
749 749
 		// ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide
750
-		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action"));
750
+		$url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action"));
751 751
 	}
752 752
 
753 753
 	if (!$no_entities) {
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 
760 760
 function generer_url_prive($script, $args = '', $no_entities = false) {
761 761
 
762
-	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php');
762
+	return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php');
763 763
 }
764 764
 
765 765
 
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 		: generer_url_public('', '', false, false);
788 788
 	$url = parametre_url($url, 'action', $script);
789 789
 	if ($args) {
790
-		$url .= quote_amp('&' . $args);
790
+		$url .= quote_amp('&'.$args);
791 791
 	}
792 792
 
793 793
 	if ($no_entities) {
@@ -821,9 +821,9 @@  discard block
 block discarded – undo
821 821
 	}
822 822
 	$url =
823 823
 		(($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './')
824
-	. $script . '/'
824
+	. $script.'/'
825 825
 	. ($path ? trim($path, '/') : '')
826
-	. ($args ? '?' . quote_amp($args) : '');
826
+	. ($args ? '?'.quote_amp($args) : '');
827 827
 
828 828
 	if ($no_entities) {
829 829
 		$url = str_replace('&amp;', '&', $url);
Please login to merge, or discard this patch.
ecrire/genie/optimiser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function optimiser_caches_contextes() {
52 52
 	sous_repertoire(_DIR_CACHE, 'contextes');
53
-	if (is_dir($d = _DIR_CACHE . 'contextes')) {
53
+	if (is_dir($d = _DIR_CACHE.'contextes')) {
54 54
 		include_spip('inc/invalideur');
55 55
 		purger_repertoire($d, ['mtime' => time() - 48 * 3600, 'limit' => 10000]);
56 56
 	}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 
98 98
 	$logger = spip_logger('genie');
99
-	$logger->debug('optimiser_base_une_table ' . json_encode($tables, JSON_THROW_ON_ERROR));
99
+	$logger->debug('optimiser_base_une_table '.json_encode($tables, JSON_THROW_ON_ERROR));
100 100
 	if ($tables) {
101 101
 		$table_op = (int) (lire_config('optimiser_table', 0) + 1) % count($tables);
102 102
 		ecrire_config('optimiser_table', $table_op);
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 	sql_free($sel);
141 141
 
142 142
 	if ($in) {
143
-		sql_delete($table, sql_in($id, array_keys($in)) . ($and ? " AND $and" : ''));
144
-		spip_logger('genie')->debug("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: " . implode(', ', array_keys($in)));
143
+		sql_delete($table, sql_in($id, array_keys($in)).($and ? " AND $and" : ''));
144
+		spip_logger('genie')->debug("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: ".implode(', ', array_keys($in)));
145 145
 	}
146 146
 
147 147
 	return count($in);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	if (!defined('_AUTEURS_DELAI_REJET_NOUVEAU')) {
222 222
 		define('_AUTEURS_DELAI_REJET_NOUVEAU', 45 * 24 * 3600);
223 223
 	}
224
-	sql_delete('spip_auteurs', "statut='nouveau' AND maj < " . sql_quote(date('Y-m-d', time() - (int) _AUTEURS_DELAI_REJET_NOUVEAU)));
224
+	sql_delete('spip_auteurs', "statut='nouveau' AND maj < ".sql_quote(date('Y-m-d', time() - (int) _AUTEURS_DELAI_REJET_NOUVEAU)));
225 225
 
226 226
 	/**
227 227
 	 * Permet aux plugins de compléter l'optimisation suite aux éléments disparus
Please login to merge, or discard this patch.