Completed
Push — master ( 518dfb...07a5e0 )
by cam
04:05
created
ecrire/public/debusquer.php 1 patch
Spacing   +86 added lines, -89 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		if (!$fonc) {
148 148
 			$fonc = $GLOBALS['debug_objets']['principal'];
149 149
 		}
150
-		$titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? " " . $GLOBALS['debug_objets']['sourcefile'][$fonc] : ""));
150
+		$titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? " ".$GLOBALS['debug_objets']['sourcefile'][$fonc] : ""));
151 151
 	}
152 152
 	if ($message === false) {
153 153
 		lang_select();
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	$fond = isset($GLOBALS['fond']) ? $GLOBALS['fond'] : "";
177 177
 	// une erreur critique sort $message en array
178 178
 	$debug = is_array($msg) ? $msg[1] : $msg;
179
-	spip_log("Debug: " . $debug . " (" . $fond . ")");
179
+	spip_log("Debug: ".$debug." (".$fond.")");
180 180
 
181 181
 	return $msg;
182 182
 }
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 function debusquer_bandeau($erreurs) {
185 185
 
186 186
 	if (!empty($erreurs)) {
187
-		$n = array(count($erreurs) . ' ' . _T('zbug_erreur_squelette'));
187
+		$n = array(count($erreurs).' '._T('zbug_erreur_squelette'));
188 188
 
189 189
 		return debusquer_navigation($erreurs, $n);
190 190
 	} elseif (!empty($GLOBALS['tableau_des_temps'])) {
@@ -218,25 +218,25 @@  discard block
 block discarded – undo
218 218
 			$valeur_simple = array();
219 219
 			foreach ($valeur as $v) {
220 220
 				if (is_array($v)) {
221
-					$valeur_simple[] = 'array:' . count($v);
221
+					$valeur_simple[] = 'array:'.count($v);
222 222
 				} elseif (is_object($v)) {
223 223
 					$valeur_simple[] = get_class($v);
224 224
 				} elseif (is_string($v)) {
225
-					$valeur_simple[] = "'" . $v . "'";
225
+					$valeur_simple[] = "'".$v."'";
226 226
 				} else {
227 227
 					$valeur_simple[] = $v;
228 228
 				}
229 229
 			}
230 230
 			$n = count($valeur);
231
-			$valeur = (($n > 3) ? 'array:' . $n . ' ' : '');
232
-			$valeur .= '[' . join(', ', $valeur_simple) . ']';
231
+			$valeur = (($n > 3) ? 'array:'.$n.' ' : '');
232
+			$valeur .= '['.join(', ', $valeur_simple).']';
233 233
 		} elseif (is_object($valeur)) {
234 234
 			$valeur = get_class($valeur);
235 235
 		} elseif (is_string($valeur)) {
236
-			$valeur = "'" . $valeur . "'";
236
+			$valeur = "'".$valeur."'";
237 237
 		}
238
-		$res .= "\n<tr><td><strong>" . nl2br(entites_html($nom))
239
-			. "</strong></td><td>:&nbsp;" . nl2br(entites_html($valeur))
238
+		$res .= "\n<tr><td><strong>".nl2br(entites_html($nom))
239
+			. "</strong></td><td>:&nbsp;".nl2br(entites_html($valeur))
240 240
 			. "</td></tr>\n";
241 241
 	}
242 242
 
@@ -264,10 +264,10 @@  discard block
 block discarded – undo
264 264
 				$nom_code = $lieu->descr['nom'];
265 265
 				$skel = $lieu->descr['sourcefile'];
266 266
 				$h2 = parametre_url($href, 'var_mode_objet', $nom_code);
267
-				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne;
267
+				$h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne;
268 268
 				$skel = "<a href='$h3'><b>$skel</b></a>";
269 269
 				if ($boucle) {
270
-					$h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle');
270
+					$h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle');
271 271
 					$boucle = "<a href='$h3'><b>$boucle</b></a>";
272 272
 				}
273 273
 			}
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 	}
355 355
 
356 356
 	// Requete erronee
357
-	$err = "<b>" . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n"
357
+	$err = "<b>"._T('avis_erreur_mysql')." $errno</b><br /><tt>\n"
358 358
 		. spip_htmlspecialchars($msg)
359 359
 		. "\n<br /><span style='color: red'><b>"
360 360
 		. spip_htmlspecialchars($query)
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 // http://code.spip.net/@trouve_boucle_debug
370 370
 function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = "") {
371 371
 
372
-	$id = $nom . $boucle;
372
+	$id = $nom.$boucle;
373 373
 	if (is_array($GLOBALS['debug_objets']['sequence'][$id])) {
374 374
 		foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) {
375 375
 
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 			}
421 421
 		}
422 422
 	}
423
-	$incl = ',' . $reg[1] . '[.]\w$,';
423
+	$incl = ','.$reg[1].'[.]\w$,';
424 424
 
425 425
 	foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) {
426 426
 		if (preg_match($incl, $v)) {
@@ -436,16 +436,13 @@  discard block
 block discarded – undo
436 436
 	list($skel, $boucle, $ligne) = trouve_boucle_debug($n, $nom);
437 437
 
438 438
 	if (!$boucle) {
439
-		return !$ligne ? "" :
440
-			(" (" .
441
-				(($nom != $skel) ? _T('squelette_inclus_ligne') :
442
-					_T('squelette_ligne')) .
439
+		return !$ligne ? "" : (" (".
440
+				(($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')).
443 441
 				" <a href='$self&amp;var_mode_objet=$skel&amp;var_mode_affiche=squelette&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)");
444 442
 	} else {
445 443
 		$self .= "&amp;var_mode_objet=$skel$boucle&amp;var_mode_affiche=boucle";
446 444
 
447
-		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" :
448
-			" (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
445
+		return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&amp;var_mode_ligne=$ligne#L$ligne'>$ligne</a>)";
449 446
 	}
450 447
 }
451 448
 
@@ -467,13 +464,13 @@  discard block
 block discarded – undo
467 464
 	}
468 465
 
469 466
 	$s = preg_replace(',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
470
-		'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
467
+		'<\1>\2</\1><br />'."\n".'<\1>\3</\1>',
471 468
 		$s);
472 469
 
473 470
 
474 471
 	$tableau = explode("<br />", $s);
475 472
 
476
-	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n";
473
+	$format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: ".($nocpt ? 'hidden' : 'visible').";%s' href='#T%s' title=\"%s\">%0".strval(@strlen(count($tableau)))."d</a></span> %s<br />\n";
477 474
 
478 475
 	$format10 = str_replace('white', 'lightgrey', $format);
479 476
 	$formaterr = "color: red;";
@@ -517,7 +514,7 @@  discard block
 block discarded – undo
517 514
 	. '" style="cursor: pointer;">'
518 515
 	. ($nocpt ? '' : _T('info_numero_abbreviation'))
519 516
 	. "</div>
520
-	" . $res . "</div>\n";
517
+	" . $res."</div>\n";
521 518
 }
522 519
 
523 520
 // l'environnement graphique du debuggueur 
@@ -538,14 +535,14 @@  discard block
 block discarded – undo
538 535
 			if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) {
539 536
 				list($legend, $texte, $res2) = debusquer_source($fonc, $mode);
540 537
 				$texte .= $res2;
541
-			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) {
542
-				$legend = _T('zbug_' . $mode);
543
-				$texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout'];
538
+			} elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) {
539
+				$legend = _T('zbug_'.$mode);
540
+				$texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout'];
544 541
 				$texte = ancre_texte($texte, array('', ''));
545 542
 			}
546 543
 		} else {
547 544
 			if (strlen(trim($res))) {
548
-				return "<img src='" . chemin_image('compat-16.png') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
545
+				return "<img src='".chemin_image('compat-16.png')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>";
549 546
 			} else {
550 547
 				// cas de l'appel sur erreur: montre la page
551 548
 				return isset($GLOBALS['debug_objets']['resultat']['tout'])
@@ -555,7 +552,7 @@  discard block
 block discarded – undo
555 552
 		}
556 553
 	} else {
557 554
 		$valider = charger_fonction('valider', 'xml');
558
-		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']);
555
+		$val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']);
559 556
 		// Si erreur, signaler leur nombre dans le formulaire admin
560 557
 		$GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : '';
561 558
 		list($texte, $err) = emboite_texte($val, $fonc, $self);
@@ -566,14 +563,14 @@  discard block
 block discarded – undo
566 563
 		} else {
567 564
 			$err = ": $err";
568 565
 		}
569
-		$legend = _T('validation') . ' ' . $err;
566
+		$legend = _T('validation').' '.$err;
570 567
 		$res = $id = '';
571 568
 	}
572 569
 
573 570
 	return !trim($texte) ? '' : (
574
-		"<img src='" . chemin_image('compat-16.png') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
571
+		"<img src='".chemin_image('compat-16.png')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res"
575 572
 		. "<div id='debug_boucle'><fieldset$id><legend>"
576
-		. "<a href='" . $self . "#f_" . substr($fonc, 0, 37) . "'> &#8593; "
573
+		. "<a href='".$self."#f_".substr($fonc, 0, 37)."'> &#8593; "
577 574
 		. ($legend ? $legend : $mode)
578 575
 		. "</a></legend>"
579 576
 		. $texte
@@ -585,7 +582,7 @@  discard block
 block discarded – undo
585 582
 // http://code.spip.net/@emboite_texte
586 583
 function emboite_texte($res, $fonc = '', $self = '') {
587 584
 	$errs = $res->err;
588
-	$texte = $res->entete . ($errs ? '' : $res->page);
585
+	$texte = $res->entete.($errs ? '' : $res->page);
589 586
 
590 587
 	if (!$texte and !$errs) {
591 588
 		return array(ancre_texte('', array('', '')), false);
@@ -642,7 +639,7 @@  discard block
 block discarded – undo
642 639
 		$err = "<h2 style='text-align: center'>"
643 640
 			. $i
644 641
 			. "<a href='#fin_err'>"
645
-			. " " . _T('erreur_texte')
642
+			. " "._T('erreur_texte')
646 643
 			. "</a></h2><table id='debut_err' style='width: 100%'>"
647 644
 			. $err
648 645
 			. " </table><a id='fin_err'></a>";
@@ -652,9 +649,9 @@  discard block
 block discarded – undo
652 649
 		list($msg, $fermant, $ouvrant) = $errs[0];
653 650
 		$rf = reference_boucle_debug($fermant, $fonc, $self);
654 651
 		$ro = reference_boucle_debug($ouvrant, $fonc, $self);
655
-		$err = $msg .
656
-			"<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" .
657
-			"<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro";
652
+		$err = $msg.
653
+			"<a href='#L".$fermant."'>$fermant</a>$rf<br />".
654
+			"<a href='#L".$ouvrant."'>$ouvrant</a>$ro";
658 655
 
659 656
 		return array(ancre_texte($texte, array(array($ouvrant), array($fermant))), $err);
660 657
 	}
@@ -686,7 +683,7 @@  discard block
 block discarded – undo
686 683
 		$temps = !isset($GLOBALS['debug_objets']['profile'][$sourcefile]) ? '' : _T('zbug_profile',
687 684
 			array('time' => $GLOBALS['debug_objets']['profile'][$sourcefile]));
688 685
 
689
-		$res .= "<fieldset id='f_" . $nom . "'><legend>"
686
+		$res .= "<fieldset id='f_".$nom."'><legend>"
690 687
 			. $t_skel
691 688
 			. ' '
692 689
 			. $sourcefile
@@ -701,7 +698,7 @@  discard block
 block discarded – undo
701 698
 			. "'>"
702 699
 			. _T('zbug_calcul')
703 700
 			. "</a></legend>"
704
-			. (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />"))
701
+			. (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />"))
705 702
 			. debusquer_contexte($contexte[$sourcefile])
706 703
 		. (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n"))
707 704
 		. "</fieldset>\n";
@@ -722,33 +719,33 @@  discard block
 block discarded – undo
722 719
 			$nom = $boucle->id_boucle;
723 720
 			$req = $boucle->type_requete;
724 721
 			$crit = public_decompiler($boucle, $gram, 0, 'criteres');
725
-			$self2 = $self . "&amp;var_mode_objet=" . $objet;
726
-
727
-			$res .= "\n<tr style='background-color: " .
728
-				($i % 2 ? '#e0e0f0' : '#f8f8ff') .
729
-				"'><td  align='right'>$i</td><td>\n" .
730
-				"<a  class='debug_link_boucle' href='" .
731
-				$self2 .
732
-				"&amp;var_mode_affiche=boucle#f_$nom_skel'>" .
733
-				_T('zbug_boucle') .
734
-				"</a></td><td>\n<a class='debug_link_boucle' href='" .
735
-				$self2 .
736
-				"&amp;var_mode_affiche=resultat#f_$nom_skel'>" .
737
-				_T('zbug_resultat') .
738
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
739
-				$self2 .
740
-				"&amp;var_mode_affiche=code#f_$nom_skel'>" .
741
-				_T('zbug_code') .
742
-				"</a></td><td>\n<a class='debug_link_resultat' href='" .
743
-				str_replace('var_mode=', 'var_profile=', $self2) .
744
-				"'>" .
745
-				_T('zbug_calcul') .
746
-				"</a></td><td>\n" .
747
-				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) .
748
-				"</td><td>\n" .
749
-				$req .
750
-				"</td><td>\n" .
751
-				spip_htmlspecialchars($crit) .
722
+			$self2 = $self."&amp;var_mode_objet=".$objet;
723
+
724
+			$res .= "\n<tr style='background-color: ".
725
+				($i % 2 ? '#e0e0f0' : '#f8f8ff').
726
+				"'><td  align='right'>$i</td><td>\n".
727
+				"<a  class='debug_link_boucle' href='".
728
+				$self2.
729
+				"&amp;var_mode_affiche=boucle#f_$nom_skel'>".
730
+				_T('zbug_boucle').
731
+				"</a></td><td>\n<a class='debug_link_boucle' href='".
732
+				$self2.
733
+				"&amp;var_mode_affiche=resultat#f_$nom_skel'>".
734
+				_T('zbug_resultat').
735
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
736
+				$self2.
737
+				"&amp;var_mode_affiche=code#f_$nom_skel'>".
738
+				_T('zbug_code').
739
+				"</a></td><td>\n<a class='debug_link_resultat' href='".
740
+				str_replace('var_mode=', 'var_profile=', $self2).
741
+				"'>".
742
+				_T('zbug_calcul').
743
+				"</a></td><td>\n".
744
+				(($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom).
745
+				"</td><td>\n".
746
+				$req.
747
+				"</td><td>\n".
748
+				spip_htmlspecialchars($crit).
752 749
 				"</td></tr>";
753 750
 		}
754 751
 	}
@@ -775,7 +772,7 @@  discard block
 block discarded – undo
775 772
 		}
776 773
 		//  permettre le copier/coller facile
777 774
 		// $res = ancre_texte($req, array(), true);
778
-		$res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n";
775
+		$res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n";
779 776
 		//  formatage et affichage des resultats bruts de la requete
780 777
 		$ress_req = spip_query($req);
781 778
 		$brut_sql = '';
@@ -785,10 +782,10 @@  discard block
 block discarded – undo
785 782
 		$max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50;
786 783
 		while ($retours_sql = sql_fetch($ress_req)) {
787 784
 			if ($num <= $max_aff) {
788
-				$brut_sql .= "<h3>" . ($num == 1 ? $num . " sur " . sql_count($ress_req) : $num) . "</h3>";
785
+				$brut_sql .= "<h3>".($num == 1 ? $num." sur ".sql_count($ress_req) : $num)."</h3>";
789 786
 				$brut_sql .= "<p>";
790 787
 				foreach ($retours_sql as $key => $val) {
791
-					$brut_sql .= "<strong>" . $key . "</strong> => " . spip_htmlspecialchars(couper($val, 150)) . "<br />\n";
788
+					$brut_sql .= "<strong>".$key."</strong> => ".spip_htmlspecialchars(couper($val, 150))."<br />\n";
792 789
 				}
793 790
 				$brut_sql .= "</p>";
794 791
 			}
@@ -799,15 +796,15 @@  discard block
 block discarded – undo
799 796
 			//  ne pas afficher les $contexte_inclus
800 797
 			$view = preg_replace(",<\?php.+\?[>],Uims", "", $view);
801 798
 			if ($view) {
802
-				$res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . "</fieldset>";
799
+				$res2 .= "\n<br /><fieldset>".interdire_scripts($view)."</fieldset>";
803 800
 			}
804 801
 		}
805 802
 
806 803
 	} elseif ($affiche == 'code') {
807 804
 		$legend = $nom;
808
-		$res = ancre_texte("<" . "?php\n" . $quoi . "\n?" . ">");
805
+		$res = ancre_texte("<"."?php\n".$quoi."\n?".">");
809 806
 	} elseif ($affiche == 'boucle') {
810
-		$legend = _T('zbug_boucle') . ' ' . $nom;
807
+		$legend = _T('zbug_boucle').' '.$nom;
811 808
 		// Le compilateur prefixe le nom des boucles par l'extension du fichier source.
812 809
 		$gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : '';
813 810
 		$res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle'));
@@ -826,23 +823,23 @@  discard block
 block discarded – undo
826 823
 	include_spip('public/assembler'); // pour inclure_balise_dynamique
827 824
 	include_spip('inc/texte'); // pour corriger_typo
828 825
 
829
-	return _DOCTYPE_ECRIRE .
830
-	html_lang_attributes() .
831
-	"<head>\n<title>" .
832
-	('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' .
833
-		_T('admin_debug') . ' ' . $titre . ' (' .
834
-		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
835
-	")</title>\n" .
836
-	"<meta http-equiv='Content-Type' content='text/html" .
837
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
838
-	"' />\n" .
826
+	return _DOCTYPE_ECRIRE.
827
+	html_lang_attributes().
828
+	"<head>\n<title>".
829
+	('SPIP '.$GLOBALS['spip_version_affichee'].' '.
830
+		_T('admin_debug').' '.$titre.' ('.
831
+		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))).
832
+	")</title>\n".
833
+	"<meta http-equiv='Content-Type' content='text/html".
834
+	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '').
835
+	"' />\n".
839 836
 	http_script('', 'jquery.js')
840
-	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
841
-	. "' type='text/css' />" .
842
-	"</head>\n" .
843
-	"<body style='margin:0 10px;'>\n" .
844
-	"<div id='spip-debug-header'>" .
845
-	$corps .
846
-	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) .
837
+	. "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css'))
838
+	. "' type='text/css' />".
839
+	"</head>\n".
840
+	"<body style='margin:0 10px;'>\n".
841
+	"<div id='spip-debug-header'>".
842
+	$corps.
843
+	inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false).
847 844
 	'</div></body></html>';
848 845
 }
Please login to merge, or discard this patch.
ecrire/public/parametrer.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 // donc il faut l'inclure "en globals"
21 21
 if ($f = find_in_path('mes_fonctions.php')) {
22 22
 	global $dossier_squelettes;
23
-	include_once(_ROOT_CWD . $f);
23
+	include_once(_ROOT_CWD.$f);
24 24
 }
25 25
 
26 26
 if (@is_readable(_CACHE_PLUGINS_FCT)) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	} else {
97 97
 		// Preparer l'appel de la fonction principale du squelette 
98 98
 
99
-		spip_timer($a = 'calcul page ' . rand(0, 1000));
99
+		spip_timer($a = 'calcul page '.rand(0, 1000));
100 100
 
101 101
 		// On cree un marqueur de notes unique lie a cette composition
102 102
 		// et on enregistre l'etat courant des globales de notes...
@@ -150,17 +150,17 @@  discard block
 block discarded – undo
150 150
 
151 151
 		$profile = spip_timer($a);
152 152
 		spip_log("calcul ($profile) [$skel] $infos"
153
-			. ' (' . strlen($page['texte']) . ' octets)');
153
+			. ' ('.strlen($page['texte']).' octets)');
154 154
 
155
-		if (defined('_CALCUL_PROFILER') AND intval($profile)>_CALCUL_PROFILER){
155
+		if (defined('_CALCUL_PROFILER') AND intval($profile) > _CALCUL_PROFILER) {
156 156
 			spip_log("calcul ($profile) [$skel] $infos"
157
-				.' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'],"profiler"._LOG_AVERTISSEMENT);
157
+				.' ('.strlen($page['texte']).' octets) | '.$_SERVER['REQUEST_URI'], "profiler"._LOG_AVERTISSEMENT);
158 158
 		}
159 159
 
160 160
 		if ($debug) {
161 161
 			// si c'est ce que demande le debusqueur, lui passer la main
162 162
 			$t = strlen($page['texte']) ? $page['texte'] : " ";
163
-			$GLOBALS['debug_objets']['resultat'][$fonc . 'tout'] = $t;
163
+			$GLOBALS['debug_objets']['resultat'][$fonc.'tout'] = $t;
164 164
 			$GLOBALS['debug_objets']['courant'] = $courant;
165 165
 			$GLOBALS['debug_objets']['profile'][$sourcefile] = $profile;
166 166
 			if ($GLOBALS['debug_objets']['sourcefile']
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		if (defined('_VAR_INCLURE') and _VAR_INCLURE) {
191 191
 			$page['sourcefile'] = $sourcefile;
192 192
 			$page['texte'] =
193
-				"<div class='inclure_blocs'><h6>" . $page['sourcefile'] . "</h6>" . $page['texte'] . "</div>"
193
+				"<div class='inclure_blocs'><h6>".$page['sourcefile']."</h6>".$page['texte']."</div>"
194 194
 				. ($js_inclus ? "" : "<script type='text/javascript'>jQuery(function(){jQuery('.inclure_blocs > h6:first-child').hover(function(){jQuery(this).parent().addClass('hover')},function(){jQuery(this).parent().removeClass('hover')})});</script>");
195 195
 			$js_inclus = true;
196 196
 		}
@@ -225,21 +225,21 @@  discard block
 block discarded – undo
225 225
 		}
226 226
 		if (is_array($val)) {
227 227
 			if ($profondeur_max > 0) {
228
-				$val = 'array:' . count($val) . '(' . presenter_contexte($val, $profondeur_max - 1, 3) . ')';
228
+				$val = 'array:'.count($val).'('.presenter_contexte($val, $profondeur_max - 1, 3).')';
229 229
 			} else {
230
-				$val = 'array:' . count($val);
230
+				$val = 'array:'.count($val);
231 231
 			}
232 232
 		} elseif (is_object($val)) {
233 233
 			$val = get_class($val);
234 234
 		} elseif (strlen("$val") > 30) {
235
-			$val = substr("$val", 0, 29) . '…';
235
+			$val = substr("$val", 0, 29).'…';
236 236
 			if (strstr($val, ' ')) {
237 237
 				$val = "'$val'";
238 238
 			}
239 239
 		} elseif (strstr($val, ' ')) {
240 240
 			$val = "'$val'";
241 241
 		}
242
-		$infos[] = $var . '=' . $val;
242
+		$infos[] = $var.'='.$val;
243 243
 	}
244 244
 	return join(', ', $infos);
245 245
 }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 						. "?php include_spip('inc/headers');redirige_par_entete('"
306 306
 						. texte_script($url)
307 307
 						. "','',$status);"
308
-						. "?" . ">",
308
+						. "?".">",
309 309
 					'process_ins' => 'php',
310 310
 					'status' => $status
311 311
 				);
Please login to merge, or discard this patch.
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
 	$r = sprintf(CODE_INCLURE_BALISE,
316 316
 		$file,
@@ -339,18 +339,18 @@  discard block
 block discarded – undo
339 339
 
340 340
 	if (is_object($v)) {
341 341
 		if (PHP_VERSION_ID < 73000 and $v instanceof \stdClass) {
342
-			return "(object) " . var_export((array) $v, true);
342
+			return "(object) ".var_export((array) $v, true);
343 343
 		}
344 344
 		return var_export($v, true);
345 345
 	} elseif (!is_array($v)) {
346
-		return "'" . texte_script($v) . "'";
346
+		return "'".texte_script($v)."'";
347 347
 	} else {
348 348
 		$out = array();
349 349
 		foreach ($v as $k => $val) {
350
-			$out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val);
350
+			$out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val);
351 351
 		}
352 352
 
353
-		return 'array(' . join(", ", $out) . ')';
353
+		return 'array('.join(", ", $out).')';
354 354
 	}
355 355
 }
356 356
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	}
416 416
 
417 417
 	// Y a-t-il une fonction de traitement des arguments ?
418
-	$f = 'balise_' . $nomfonction . '_stat';
418
+	$f = 'balise_'.$nomfonction.'_stat';
419 419
 
420 420
 	$r = !function_exists($f) ? $args : $f($args, $context_compil);
421 421
 
@@ -425,16 +425,16 @@  discard block
 block discarded – undo
425 425
 
426 426
 	// verifier que la fonction dyn est la, 
427 427
 	// sinon se replier sur la generique si elle existe
428
-	if (!function_exists('balise_' . $nomfonction . '_dyn')) {
428
+	if (!function_exists('balise_'.$nomfonction.'_dyn')) {
429 429
 		if ($nomfonction_generique
430
-			and $file = include_spip("balise/" . strtolower($nomfonction_generique))
431
-			and function_exists('balise_' . $nomfonction_generique . '_dyn')
430
+			and $file = include_spip("balise/".strtolower($nomfonction_generique))
431
+			and function_exists('balise_'.$nomfonction_generique.'_dyn')
432 432
 		) {
433 433
 			// et lui injecter en premier arg le nom de la balise 
434 434
 			array_unshift($r, $nom);
435 435
 			$nomfonction = $nomfonction_generique;
436 436
 			if (!_DIR_RESTREINT) {
437
-				$file = _DIR_RESTREINT_ABS . $file;
437
+				$file = _DIR_RESTREINT_ABS.$file;
438 438
 			}
439 439
 		} else {
440 440
 			$msg = array('zbug_balise_inexistante', array('from' => 'CVT', 'balise' => $nom));
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 		$n = '';
502 502
 		foreach (explode(',', $liste) as $val) {
503 503
 			if ($a = intval($val) and $val === strval($a)) {
504
-				$n .= ',' . $val;
504
+				$n .= ','.$val;
505 505
 			}
506 506
 		}
507 507
 		if (strlen($n)) {
@@ -680,14 +680,14 @@  discard block
 block discarded – undo
680 680
 			// on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction
681 681
 			$i = 0;
682 682
 			do {
683
-				$where[$k] = remplace_sous_requete($w, "(" . calculer_select(
684
-						array($sous[1] . " AS id"),
683
+				$where[$k] = remplace_sous_requete($w, "(".calculer_select(
684
+						array($sous[1]." AS id"),
685 685
 						$from,
686 686
 						$from_type,
687 687
 						$wheresub,
688 688
 						$jsub,
689 689
 						array(), array(), '',
690
-						$having, $table, $id, $serveur, false) . ")");
690
+						$having, $table, $id, $serveur, false).")");
691 691
 				if (!$i) {
692 692
 					$i = 1;
693 693
 					$wherestring = calculer_where_to_string($where[$k]);
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 		if ($sous[0] == 'SUBSELECT') {
707 707
 			// c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having)
708 708
 			array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ?
709
-			$where[$k] = remplace_sous_requete($w, "(" . calculer_select(
709
+			$where[$k] = remplace_sous_requete($w, "(".calculer_select(
710 710
 					$sous[1], # select
711 711
 					$sous[2], #from
712 712
 					array(), #from_type
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 					$sous[6], #limit
719 719
 					$sous[7] ? $sous[7] : array(), #having
720 720
 					$table, $id, $serveur, false
721
-				) . ")");
721
+				).")");
722 722
 		}
723 723
 		array_pop($where_simples);
724 724
 	}
@@ -779,15 +779,15 @@  discard block
 block discarded – undo
779 779
 			// sans recours a preg_match
780 780
 			// un implode(' ',..) est fait dans reinjecte_joint un peu plus bas
781 781
 			$afrom[$t][$cle] = array(
782
-				"\n" .
783
-				(isset($from_type[$cle]) ? $from_type[$cle] : "INNER") . " JOIN",
782
+				"\n".
783
+				(isset($from_type[$cle]) ? $from_type[$cle] : "INNER")." JOIN",
784 784
 				$from[$cle],
785 785
 				"AS $cle",
786 786
 				"ON (",
787 787
 				"$cle.$c",
788 788
 				"=",
789 789
 				"$t.$carr",
790
-				($and ? "AND " . $and : "") .
790
+				($and ? "AND ".$and : "").
791 791
 				")"
792 792
 			);
793 793
 			if (isset($afrom[$cle])) {
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 		$t = key($from);
822 822
 		$c = current($from);
823 823
 		reset($from);
824
-		$e = '/\b(' . "$t\\." . join("|" . $t . '\.', $equiv) . ')\b/';
824
+		$e = '/\b('."$t\\.".join("|".$t.'\.', $equiv).')\b/';
825 825
 		if (!(strpos($t, ' ') or // jointure des le depart cf boucle_doc
826 826
 				calculer_jointnul($t, $select, $e) or
827 827
 				calculer_jointnul($t, $join, $e) or
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 			unset($afrom[$t][$nt]);
839 839
 			$afrom[$nt] = $afrom[$t];
840 840
 			unset($afrom[$t]);
841
-			$e = '/\b' . preg_quote($nfrom[6]) . '\b/';
841
+			$e = '/\b'.preg_quote($nfrom[6]).'\b/';
842 842
 			$t = $nfrom[4];
843 843
 			$alias = "";
844 844
 			// verifier que les deux cles sont homonymes, sinon installer un alias dans le select
@@ -849,14 +849,14 @@  discard block
 block discarded – undo
849 849
 			if ($newcle != $oldcle) {
850 850
 				// si l'ancienne cle etait deja dans le select avec un AS
851 851
 				// reprendre simplement ce AS
852
-				$as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/';
852
+				$as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/';
853 853
 				if (preg_match($as, implode(',', $select), $m)) {
854 854
 					$alias = "";
855 855
 				} else {
856
-					$alias = ", " . $nfrom[4] . " AS $oldcle";
856
+					$alias = ", ".$nfrom[4]." AS $oldcle";
857 857
 				}
858 858
 			}
859
-			$select = remplacer_jointnul($t . $alias, $select, $e);
859
+			$select = remplacer_jointnul($t.$alias, $select, $e);
860 860
 			$join = remplacer_jointnul($t, $join, $e);
861 861
 			$where = remplacer_jointnul($t, $where, $e);
862 862
 			$having = remplacer_jointnul($t, $having, $e);
@@ -890,9 +890,9 @@  discard block
 block discarded – undo
890 890
 	} else {
891 891
 		$exp = "";
892 892
 		if (strtoupper($join) === 'AND') {
893
-			return $exp . join(" $join ", array_map('calculer_where_to_string', $v));
893
+			return $exp.join(" $join ", array_map('calculer_where_to_string', $v));
894 894
 		} else {
895
-			return $exp . join($join, $v);
895
+			return $exp.join($join, $v);
896 896
 		}
897 897
 	}
898 898
 }
@@ -958,6 +958,6 @@  discard block
 block discarded – undo
958 958
 	}
959 959
 
960 960
 	return $mime_type
961
-	. (!$connect ? '' : preg_replace('/\W/', "_", $connect)) . '_'
962
-	. md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : ''));
961
+	. (!$connect ? '' : preg_replace('/\W/', "_", $connect)).'_'
962
+	. md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : ''));
963 963
 }
Please login to merge, or discard this patch.