Completed
Push — master ( 03d021...09bea4 )
by cam
04:40
created
ecrire/public/composer.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$GLOBALS['debug_objets']['courant'] = $nom;
55 55
 	}
56 56
 
57
-	$phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php';
57
+	$phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php';
58 58
 
59 59
 	// si squelette est deja compile et perenne, le charger
60 60
 	if (!squelette_obsolete($phpfile, $source)) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		#}
68 68
 	}
69 69
 
70
-	if (file_exists($lib = $squelette . '_fonctions' . '.php')) {
70
+	if (file_exists($lib = $squelette.'_fonctions'.'.php')) {
71 71
 		include_once $lib;
72 72
 	}
73 73
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			}
106 106
 		} catch (\ParseError $e) {
107 107
 			// Code syntaxiquement faux (critere etc mal programme')
108
-			$msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage();
108
+			$msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage();
109 109
 			erreur_squelette($msg, $boucle);
110 110
 			// continuer pour trouver d'autres fautes eventuelles
111 111
 			// mais prevenir que c'est mort
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	if (defined('_VAR_MODE') and _VAR_MODE == 'debug') {
135 135
 
136 136
 		// Tracer ce qui vient d'etre compile
137
-		$GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code;
137
+		$GLOBALS['debug_objets']['code'][$nom.'tout'] = $code;
138 138
 
139 139
 		// si c'est ce que demande le debusqueur, lui passer la main
140 140
 		if ($GLOBALS['debug_objets']['sourcefile']
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
 		$code = "
157 157
 /*
158 158
  * Squelette : $sourcefile
159
- * Date :      " . gmdate("D, d M Y H:i:s", @filemtime($sourcefile)) . " GMT
160
- * Compile :   " . gmdate("D, d M Y H:i:s", time()) . " GMT
161
- * " . (!$boucles ? "Pas de boucle" : ("Boucles :   " . $noms)) . "
159
+ * Date :      ".gmdate("D, d M Y H:i:s", @filemtime($sourcefile))." GMT
160
+ * Compile :   " . gmdate("D, d M Y H:i:s", time())." GMT
161
+ * " . (!$boucles ? "Pas de boucle" : ("Boucles :   ".$noms))."
162 162
  */ ";
163 163
 	}
164 164
 
165
-	$code = '<' . "?php\n" . $code . join('', $boucles) . "\n?" . '>';
165
+	$code = '<'."?php\n".$code.join('', $boucles)."\n?".'>';
166 166
 	if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) {
167 167
 		ecrire_fichier($phpfile, $code);
168 168
 	}
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 			$j = join('-', array_map('ucwords', explode('-', strtolower($r[2]))));
223 223
 
224 224
 			if ($j == 'X-Spip-Filtre' and isset($headers[$j])) {
225
-				$headers[$j] .= "|" . $r[3];
225
+				$headers[$j] .= "|".$r[3];
226 226
 			} else {
227 227
 				$headers[$j] = $r[3];
228 228
 			}
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 	}
231 231
 	// S'agit-il d'un resultat constant ou contenant du code php
232 232
 	$process_ins = (
233
-		strpos($corps, '<' . '?') === false
233
+		strpos($corps, '<'.'?') === false
234 234
 		or
235
-		(strpos($corps, '<' . '?xml') !== false and
236
-			strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false)
235
+		(strpos($corps, '<'.'?xml') !== false and
236
+			strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false)
237 237
 	)
238 238
 		? 'html'
239 239
 		: 'php';
@@ -262,10 +262,10 @@  discard block
 block discarded – undo
262 262
 
263 263
 		if ($process_ins == 'html') {
264 264
 			$skel['process_ins'] = (
265
-				strpos($corps, '<' . '?') === false
265
+				strpos($corps, '<'.'?') === false
266 266
 				or
267
-				(strpos($corps, '<' . '?xml') !== false and
268
-					strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false)
267
+				(strpos($corps, '<'.'?xml') !== false and
268
+					strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false)
269 269
 			)
270 270
 				? 'html'
271 271
 				: 'php';
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 //
284 284
 
285 285
 /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */
286
-define('CODE_INCLURE_BALISE', '<' . '?php 
286
+define('CODE_INCLURE_BALISE', '<'.'?php 
287 287
 include_once("%s");
288 288
 if ($lang_select = "%s") $lang_select = lang_select($lang_select);
289 289
 inserer_balise_dynamique(balise_%s_dyn(%s), array(%s));
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
  **/
311 311
 function synthetiser_balise_dynamique($nom, $args, $file, $context_compil) {
312 312
 	if (strncmp($file, "/", 1) !== 0) {
313
-		$file = './" . _DIR_RACINE . "' . $file;
313
+		$file = './" . _DIR_RACINE . "'.$file;
314 314
 	}
315 315
 
316 316
 	$lang = $context_compil[4];
@@ -351,18 +351,18 @@  discard block
 block discarded – undo
351 351
 
352 352
 	if (is_object($v)) {
353 353
 		if (PHP_VERSION_ID < 73000 and $v instanceof \stdClass) {
354
-			return "(object) " . var_export((array) $v, true);
354
+			return "(object) ".var_export((array) $v, true);
355 355
 		}
356 356
 		return var_export($v, true);
357 357
 	} elseif (!is_array($v)) {
358
-		return "'" . texte_script($v) . "'";
358
+		return "'".texte_script($v)."'";
359 359
 	} else {
360 360
 		$out = array();
361 361
 		foreach ($v as $k => $val) {
362
-			$out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val);
362
+			$out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val);
363 363
 		}
364 364
 
365
-		return 'array(' . join(", ", $out) . ')';
365
+		return 'array('.join(", ", $out).')';
366 366
 	}
367 367
 }
368 368
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 	}
439 439
 
440 440
 	// Y a-t-il une fonction de traitement des arguments ?
441
-	$f = 'balise_' . $nom_balise . '_stat';
441
+	$f = 'balise_'.$nom_balise.'_stat';
442 442
 
443 443
 	$r = !function_exists($f) ? $args : $f($args, $context_compil);
444 444
 
@@ -448,18 +448,18 @@  discard block
 block discarded – undo
448 448
 
449 449
 	// verifier que la fonction dyn est la, 
450 450
 	// sinon se replier sur la generique si elle existe
451
-	if (!function_exists('balise_' . $nom_balise . '_dyn')) {
451
+	if (!function_exists('balise_'.$nom_balise.'_dyn')) {
452 452
 		if (
453 453
 			$balise_generique = chercher_balise_generique($nom)
454 454
 			and $nom_balise_generique = $balise_generique['nom_generique']
455
-			and $file = include_spip("balise/" . strtolower($nom_balise_generique))
456
-			and function_exists('balise_' . $nom_balise_generique . '_dyn')
455
+			and $file = include_spip("balise/".strtolower($nom_balise_generique))
456
+			and function_exists('balise_'.$nom_balise_generique.'_dyn')
457 457
 		) {
458 458
 			// et lui injecter en premier arg le nom de la balise 
459 459
 			array_unshift($r, $nom);
460 460
 			$nom_balise = $nom_balise_generique;
461 461
 			if (!_DIR_RESTREINT) {
462
-				$file = _DIR_RESTREINT_ABS . $file;
462
+				$file = _DIR_RESTREINT_ABS.$file;
463 463
 			}
464 464
 		} else {
465 465
 			$msg = array('zbug_balise_inexistante', array('from' => 'CVT', 'balise' => $nom));
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		$n = '';
561 561
 		foreach (explode(',', $liste) as $val) {
562 562
 			if ($a = intval($val) and $val === strval($a)) {
563
-				$n .= ',' . $val;
563
+				$n .= ','.$val;
564 564
 			}
565 565
 		}
566 566
 		if (strlen($n)) {
@@ -739,14 +739,14 @@  discard block
 block discarded – undo
739 739
 			// on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction
740 740
 			$i = 0;
741 741
 			do {
742
-				$where[$k] = remplace_sous_requete($w, "(" . calculer_select(
743
-						array($sous[1] . " AS id"),
742
+				$where[$k] = remplace_sous_requete($w, "(".calculer_select(
743
+						array($sous[1]." AS id"),
744 744
 						$from,
745 745
 						$from_type,
746 746
 						$wheresub,
747 747
 						$jsub,
748 748
 						array(), array(), '',
749
-						$having, $table, $id, $serveur, false) . ")");
749
+						$having, $table, $id, $serveur, false).")");
750 750
 				if (!$i) {
751 751
 					$i = 1;
752 752
 					$wherestring = calculer_where_to_string($where[$k]);
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 		if ($sous[0] == 'SUBSELECT') {
766 766
 			// c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having)
767 767
 			array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ?
768
-			$where[$k] = remplace_sous_requete($w, "(" . calculer_select(
768
+			$where[$k] = remplace_sous_requete($w, "(".calculer_select(
769 769
 					$sous[1], # select
770 770
 					$sous[2], #from
771 771
 					array(), #from_type
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 					$sous[6], #limit
778 778
 					$sous[7] ? $sous[7] : array(), #having
779 779
 					$table, $id, $serveur, false
780
-				) . ")");
780
+				).")");
781 781
 		}
782 782
 		array_pop($where_simples);
783 783
 	}
@@ -839,15 +839,15 @@  discard block
 block discarded – undo
839 839
 			// sans recours a preg_match
840 840
 			// un implode(' ',..) est fait dans reinjecte_joint un peu plus bas
841 841
 			$afrom[$t][$cle] = array(
842
-				"\n" .
843
-				(isset($from_type[$cle]) ? $from_type[$cle] : "INNER") . " JOIN",
842
+				"\n".
843
+				(isset($from_type[$cle]) ? $from_type[$cle] : "INNER")." JOIN",
844 844
 				$from[$cle],
845 845
 				"AS $cle",
846 846
 				"ON (",
847 847
 				"$cle.$c",
848 848
 				"=",
849 849
 				"$t.$carr",
850
-				($and ? "AND " . $and : "") .
850
+				($and ? "AND ".$and : "").
851 851
 				")"
852 852
 			);
853 853
 			if (isset($afrom[$cle])) {
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 		$t = key($from);
886 886
 		$c = current($from);
887 887
 		reset($from);
888
-		$e = '/\b(' . "$t\\." . join("|" . $t . '\.', $equiv) . ')\b/';
888
+		$e = '/\b('."$t\\.".join("|".$t.'\.', $equiv).')\b/';
889 889
 		if (!(strpos($t, ' ') or // jointure des le depart cf boucle_doc
890 890
 				calculer_jointnul($t, $select, $e) or
891 891
 				calculer_jointnul($t, $join, $e) or
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 			unset($afrom[$t][$nt]);
903 903
 			$afrom[$nt] = $afrom[$t];
904 904
 			unset($afrom[$t]);
905
-			$e = '/\b' . preg_quote($nfrom[6]) . '\b/';
905
+			$e = '/\b'.preg_quote($nfrom[6]).'\b/';
906 906
 			$t = $nfrom[4];
907 907
 			$alias = "";
908 908
 			// verifier que les deux cles sont homonymes, sinon installer un alias dans le select
@@ -913,14 +913,14 @@  discard block
 block discarded – undo
913 913
 			if ($newcle != $oldcle) {
914 914
 				// si l'ancienne cle etait deja dans le select avec un AS
915 915
 				// reprendre simplement ce AS
916
-				$as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/';
916
+				$as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/';
917 917
 				if (preg_match($as, implode(',', $select), $m)) {
918 918
 					$alias = "";
919 919
 				} else {
920
-					$alias = ", " . $nfrom[4] . " AS $oldcle";
920
+					$alias = ", ".$nfrom[4]." AS $oldcle";
921 921
 				}
922 922
 			}
923
-			$select = remplacer_jointnul($t . $alias, $select, $e);
923
+			$select = remplacer_jointnul($t.$alias, $select, $e);
924 924
 			$join = remplacer_jointnul($t, $join, $e);
925 925
 			$where = remplacer_jointnul($t, $where, $e);
926 926
 			$having = remplacer_jointnul($t, $having, $e);
@@ -954,9 +954,9 @@  discard block
 block discarded – undo
954 954
 	} else {
955 955
 		$exp = "";
956 956
 		if (strtoupper($join) === 'AND') {
957
-			return $exp . join(" $join ", array_map('calculer_where_to_string', $v));
957
+			return $exp.join(" $join ", array_map('calculer_where_to_string', $v));
958 958
 		} else {
959
-			return $exp . join($join, $v);
959
+			return $exp.join($join, $v);
960 960
 		}
961 961
 	}
962 962
 }
@@ -1022,6 +1022,6 @@  discard block
 block discarded – undo
1022 1022
 	}
1023 1023
 
1024 1024
 	return $mime_type
1025
-	. (!$connect ? '' : preg_replace('/\W/', "_", $connect)) . '_'
1026
-	. md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : ''));
1025
+	. (!$connect ? '' : preg_replace('/\W/', "_", $connect)).'_'
1026
+	. md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : ''));
1027 1027
 }
Please login to merge, or discard this patch.