@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if (!$fonc) { |
| 138 | 138 | $fonc = $GLOBALS['debug_objets']['principal']; |
| 139 | 139 | } |
| 140 | - $titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : '')); |
|
| 140 | + $titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : '')); |
|
| 141 | 141 | } |
| 142 | 142 | if ($message === false) { |
| 143 | 143 | lang_select(); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $fond = $GLOBALS['fond'] ?? ''; |
| 167 | 167 | // une erreur critique sort $message en array |
| 168 | 168 | $debug = is_array($msg) ? $msg[1] : $msg; |
| 169 | - spip_log('Debug: ' . $debug . ' (' . $fond . ')'); |
|
| 169 | + spip_log('Debug: '.$debug.' ('.$fond.')'); |
|
| 170 | 170 | |
| 171 | 171 | return $msg; |
| 172 | 172 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | function debusquer_bandeau($erreurs) { |
| 175 | 175 | |
| 176 | 176 | if (!empty($erreurs)) { |
| 177 | - $n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')]; |
|
| 177 | + $n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')]; |
|
| 178 | 178 | |
| 179 | 179 | return debusquer_navigation($erreurs, $n); |
| 180 | 180 | } elseif (!empty($GLOBALS['tableau_des_temps'])) { |
@@ -207,25 +207,25 @@ discard block |
||
| 207 | 207 | $valeur_simple = []; |
| 208 | 208 | foreach ($valeur as $v) { |
| 209 | 209 | if (is_array($v)) { |
| 210 | - $valeur_simple[] = 'array:' . count($v); |
|
| 210 | + $valeur_simple[] = 'array:'.count($v); |
|
| 211 | 211 | } elseif (is_object($v)) { |
| 212 | 212 | $valeur_simple[] = get_class($v); |
| 213 | 213 | } elseif (is_string($v)) { |
| 214 | - $valeur_simple[] = "'" . $v . "'"; |
|
| 214 | + $valeur_simple[] = "'".$v."'"; |
|
| 215 | 215 | } else { |
| 216 | 216 | $valeur_simple[] = $v; |
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | $n = count($valeur); |
| 220 | - $valeur = (($n > 3) ? 'array:' . $n . ' ' : ''); |
|
| 221 | - $valeur .= '[' . join(', ', $valeur_simple) . ']'; |
|
| 220 | + $valeur = (($n > 3) ? 'array:'.$n.' ' : ''); |
|
| 221 | + $valeur .= '['.join(', ', $valeur_simple).']'; |
|
| 222 | 222 | } elseif (is_object($valeur)) { |
| 223 | 223 | $valeur = get_class($valeur); |
| 224 | 224 | } elseif (is_string($valeur)) { |
| 225 | - $valeur = "'" . $valeur . "'"; |
|
| 225 | + $valeur = "'".$valeur."'"; |
|
| 226 | 226 | } |
| 227 | - $res .= "\n<tr><td><strong>" . nl2br((string) entites_html($nom)) |
|
| 228 | - . '</strong></td><td>: ' . nl2br((string) entites_html($valeur)) |
|
| 227 | + $res .= "\n<tr><td><strong>".nl2br((string) entites_html($nom)) |
|
| 228 | + . '</strong></td><td>: '.nl2br((string) entites_html($valeur)) |
|
| 229 | 229 | . "</td></tr>\n"; |
| 230 | 230 | } |
| 231 | 231 | |
@@ -253,10 +253,10 @@ discard block |
||
| 253 | 253 | $nom_code = $lieu->descr['nom']; |
| 254 | 254 | $skel = $lieu->descr['sourcefile']; |
| 255 | 255 | $h2 = parametre_url($href, 'var_mode_objet', $nom_code); |
| 256 | - $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne; |
|
| 256 | + $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne; |
|
| 257 | 257 | $skel = "<a href='$h3'><b>$skel</b></a>"; |
| 258 | 258 | if ($boucle) { |
| 259 | - $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle'); |
|
| 259 | + $h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle'); |
|
| 260 | 260 | $boucle = "<a href='$h3'><b>$boucle</b></a>"; |
| 261 | 261 | } |
| 262 | 262 | } |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | // Requete erronee |
| 348 | - $err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n" |
|
| 348 | + $err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n" |
|
| 349 | 349 | . spip_htmlspecialchars($msg) |
| 350 | 350 | . "\n<br /><span style='color: red'><b>" |
| 351 | 351 | . spip_htmlspecialchars($query) |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') { |
| 361 | 361 | |
| 362 | - $id = $nom . $boucle; |
|
| 362 | + $id = $nom.$boucle; |
|
| 363 | 363 | if (is_array($GLOBALS['debug_objets']['sequence'][$id])) { |
| 364 | 364 | foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) { |
| 365 | 365 | if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | - $incl = ',' . $reg[1] . '[.]\w$,'; |
|
| 408 | + $incl = ','.$reg[1].'[.]\w$,'; |
|
| 409 | 409 | |
| 410 | 410 | foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) { |
| 411 | 411 | if (preg_match($incl, $v)) { |
@@ -420,16 +420,13 @@ discard block |
||
| 420 | 420 | [$skel, $boucle, $ligne] = trouve_boucle_debug($n, $nom); |
| 421 | 421 | |
| 422 | 422 | if (!$boucle) { |
| 423 | - return !$ligne ? '' : |
|
| 424 | - (' (' . |
|
| 425 | - (($nom != $skel) ? _T('squelette_inclus_ligne') : |
|
| 426 | - _T('squelette_ligne')) . |
|
| 423 | + return !$ligne ? '' : (' ('. |
|
| 424 | + (($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')). |
|
| 427 | 425 | " <a href='$self&var_mode_objet=$skel&var_mode_affiche=squelette&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"); |
| 428 | 426 | } else { |
| 429 | 427 | $self .= "&var_mode_objet=$skel$boucle&var_mode_affiche=boucle"; |
| 430 | 428 | |
| 431 | - return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : |
|
| 432 | - " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 429 | + return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 433 | 430 | } |
| 434 | 431 | } |
| 435 | 432 | |
@@ -451,14 +448,14 @@ discard block |
||
| 451 | 448 | |
| 452 | 449 | $s = preg_replace( |
| 453 | 450 | ',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,', |
| 454 | - '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>', |
|
| 451 | + '<\1>\2</\1><br />'."\n".'<\1>\3</\1>', |
|
| 455 | 452 | $s |
| 456 | 453 | ); |
| 457 | 454 | |
| 458 | 455 | |
| 459 | 456 | $tableau = explode('<br />', $s); |
| 460 | 457 | |
| 461 | - $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"; |
|
| 458 | + $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"; |
|
| 462 | 459 | |
| 463 | 460 | $format10 = str_replace('white', 'lightgrey', $format); |
| 464 | 461 | $formaterr = 'color: red;'; |
@@ -502,7 +499,7 @@ discard block |
||
| 502 | 499 | . '" style="cursor: pointer;">' |
| 503 | 500 | . ($nocpt ? '' : _T('info_numero_abbreviation')) |
| 504 | 501 | . '</div> |
| 505 | - ' . $res . "</div>\n"; |
|
| 502 | + ' . $res."</div>\n"; |
|
| 506 | 503 | } |
| 507 | 504 | |
| 508 | 505 | // l'environnement graphique du debuggueur |
@@ -524,14 +521,14 @@ discard block |
||
| 524 | 521 | if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) { |
| 525 | 522 | [$legend, $texte, $res2] = debusquer_source($fonc, $mode); |
| 526 | 523 | $texte .= $res2; |
| 527 | - } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) { |
|
| 528 | - $legend = _T('zbug_' . $mode); |
|
| 529 | - $texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout']; |
|
| 524 | + } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) { |
|
| 525 | + $legend = _T('zbug_'.$mode); |
|
| 526 | + $texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout']; |
|
| 530 | 527 | $texte = ancre_texte($texte, ['', '']); |
| 531 | 528 | } |
| 532 | 529 | } else { |
| 533 | 530 | if (strlen(trim($res))) { |
| 534 | - return "<img src='" . chemin_image('debug-xx.svg') . "' 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>"; |
|
| 531 | + return "<img src='".chemin_image('debug-xx.svg')."' 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>"; |
|
| 535 | 532 | } else { |
| 536 | 533 | // cas de l'appel sur erreur: montre la page |
| 537 | 534 | return $GLOBALS['debug_objets']['resultat']['tout'] ?? ''; |
@@ -539,7 +536,7 @@ discard block |
||
| 539 | 536 | } |
| 540 | 537 | } else { |
| 541 | 538 | $valider = charger_fonction('valider', 'xml'); |
| 542 | - $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']); |
|
| 539 | + $val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']); |
|
| 543 | 540 | // Si erreur, signaler leur nombre dans le formulaire admin |
| 544 | 541 | $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : ''; |
| 545 | 542 | [$texte, $err] = emboite_texte($val, $fonc, $self); |
@@ -550,14 +547,14 @@ discard block |
||
| 550 | 547 | } else { |
| 551 | 548 | $err = ": $err"; |
| 552 | 549 | } |
| 553 | - $legend = _T('validation') . ' ' . $err; |
|
| 550 | + $legend = _T('validation').' '.$err; |
|
| 554 | 551 | $res = $id = ''; |
| 555 | 552 | } |
| 556 | 553 | |
| 557 | 554 | return !trim($texte) ? '' : ( |
| 558 | - "<img src='" . chemin_image('debug-xx.svg') . "' 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" |
|
| 555 | + "<img src='".chemin_image('debug-xx.svg')."' 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" |
|
| 559 | 556 | . "<div id='debug_boucle'><fieldset$id><legend>" |
| 560 | - . "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> ↑ " |
|
| 557 | + . "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> ↑ " |
|
| 561 | 558 | . ($legend ?: $mode) |
| 562 | 559 | . '</a></legend>' |
| 563 | 560 | . $texte |
@@ -568,7 +565,7 @@ discard block |
||
| 568 | 565 | |
| 569 | 566 | function emboite_texte($res, $fonc = '', $self = '') { |
| 570 | 567 | $errs = $res->err; |
| 571 | - $texte = $res->entete . ($errs ? '' : $res->page); |
|
| 568 | + $texte = $res->entete.($errs ? '' : $res->page); |
|
| 572 | 569 | |
| 573 | 570 | if (!$texte and !$errs) { |
| 574 | 571 | return [ancre_texte('', ['', '']), false]; |
@@ -624,7 +621,7 @@ discard block |
||
| 624 | 621 | $err = "<h2 style='text-align: center'>" |
| 625 | 622 | . $i |
| 626 | 623 | . "<a href='#fin_err'>" |
| 627 | - . ' ' . _T('erreur_texte') |
|
| 624 | + . ' '._T('erreur_texte') |
|
| 628 | 625 | . "</a></h2><table id='debut_err' style='width: 100%'>" |
| 629 | 626 | . $err |
| 630 | 627 | . " </table><a id='fin_err'></a>"; |
@@ -634,9 +631,9 @@ discard block |
||
| 634 | 631 | [$msg, $fermant, $ouvrant] = $errs[0]; |
| 635 | 632 | $rf = reference_boucle_debug($fermant, $fonc, $self); |
| 636 | 633 | $ro = reference_boucle_debug($ouvrant, $fonc, $self); |
| 637 | - $err = $msg . |
|
| 638 | - "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" . |
|
| 639 | - "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro"; |
|
| 634 | + $err = $msg. |
|
| 635 | + "<a href='#L".$fermant."'>$fermant</a>$rf<br />". |
|
| 636 | + "<a href='#L".$ouvrant."'>$ouvrant</a>$ro"; |
|
| 640 | 637 | |
| 641 | 638 | return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err]; |
| 642 | 639 | } |
@@ -669,7 +666,7 @@ discard block |
||
| 669 | 666 | ['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]] |
| 670 | 667 | ); |
| 671 | 668 | |
| 672 | - $res .= "<fieldset id='f_" . $nom . "'><legend>" |
|
| 669 | + $res .= "<fieldset id='f_".$nom."'><legend>" |
|
| 673 | 670 | . $t_skel |
| 674 | 671 | . ' ' |
| 675 | 672 | . $sourcefile |
@@ -684,7 +681,7 @@ discard block |
||
| 684 | 681 | . "'>" |
| 685 | 682 | . _T('zbug_calcul') |
| 686 | 683 | . '</a></legend>' |
| 687 | - . (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />")) |
|
| 684 | + . (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />")) |
|
| 688 | 685 | . debusquer_contexte($contexte[$sourcefile]) |
| 689 | 686 | . (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n")) |
| 690 | 687 | . "</fieldset>\n"; |
@@ -705,33 +702,33 @@ discard block |
||
| 705 | 702 | $nom = $boucle->id_boucle; |
| 706 | 703 | $req = $boucle->type_requete; |
| 707 | 704 | $crit = public_decompiler($boucle, $gram, 0, 'criteres'); |
| 708 | - $self2 = $self . '&var_mode_objet=' . $objet; |
|
| 709 | - |
|
| 710 | - $res .= "\n<tr style='background-color: " . |
|
| 711 | - ($i % 2 ? '#e0e0f0' : '#f8f8ff') . |
|
| 712 | - "'><td align='right'>$i</td><td>\n" . |
|
| 713 | - "<a class='debug_link_boucle' href='" . |
|
| 714 | - $self2 . |
|
| 715 | - "&var_mode_affiche=boucle#f_$nom_skel'>" . |
|
| 716 | - _T('zbug_boucle') . |
|
| 717 | - "</a></td><td>\n<a class='debug_link_boucle' href='" . |
|
| 718 | - $self2 . |
|
| 719 | - "&var_mode_affiche=resultat#f_$nom_skel'>" . |
|
| 720 | - _T('zbug_resultat') . |
|
| 721 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 722 | - $self2 . |
|
| 723 | - "&var_mode_affiche=code#f_$nom_skel'>" . |
|
| 724 | - _T('zbug_code') . |
|
| 725 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 726 | - str_replace('var_mode=', 'var_profile=', $self2) . |
|
| 727 | - "'>" . |
|
| 728 | - _T('zbug_calcul') . |
|
| 729 | - "</a></td><td>\n" . |
|
| 730 | - (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) . |
|
| 731 | - "</td><td>\n" . |
|
| 732 | - $req . |
|
| 733 | - "</td><td>\n" . |
|
| 734 | - spip_htmlspecialchars($crit) . |
|
| 705 | + $self2 = $self.'&var_mode_objet='.$objet; |
|
| 706 | + |
|
| 707 | + $res .= "\n<tr style='background-color: ". |
|
| 708 | + ($i % 2 ? '#e0e0f0' : '#f8f8ff'). |
|
| 709 | + "'><td align='right'>$i</td><td>\n". |
|
| 710 | + "<a class='debug_link_boucle' href='". |
|
| 711 | + $self2. |
|
| 712 | + "&var_mode_affiche=boucle#f_$nom_skel'>". |
|
| 713 | + _T('zbug_boucle'). |
|
| 714 | + "</a></td><td>\n<a class='debug_link_boucle' href='". |
|
| 715 | + $self2. |
|
| 716 | + "&var_mode_affiche=resultat#f_$nom_skel'>". |
|
| 717 | + _T('zbug_resultat'). |
|
| 718 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 719 | + $self2. |
|
| 720 | + "&var_mode_affiche=code#f_$nom_skel'>". |
|
| 721 | + _T('zbug_code'). |
|
| 722 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 723 | + str_replace('var_mode=', 'var_profile=', $self2). |
|
| 724 | + "'>". |
|
| 725 | + _T('zbug_calcul'). |
|
| 726 | + "</a></td><td>\n". |
|
| 727 | + (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom). |
|
| 728 | + "</td><td>\n". |
|
| 729 | + $req. |
|
| 730 | + "</td><td>\n". |
|
| 731 | + spip_htmlspecialchars($crit). |
|
| 735 | 732 | '</td></tr>'; |
| 736 | 733 | } |
| 737 | 734 | } |
@@ -758,7 +755,7 @@ discard block |
||
| 758 | 755 | } |
| 759 | 756 | // permettre le copier/coller facile |
| 760 | 757 | // $res = ancre_texte($req, array(), true); |
| 761 | - $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; |
|
| 758 | + $res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n"; |
|
| 762 | 759 | // formatage et affichage des resultats bruts de la requete |
| 763 | 760 | $ress_req = spip_query($req); |
| 764 | 761 | $brut_sql = ''; |
@@ -768,10 +765,10 @@ discard block |
||
| 768 | 765 | $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; |
| 769 | 766 | while ($retours_sql = sql_fetch($ress_req)) { |
| 770 | 767 | if ($num <= $max_aff) { |
| 771 | - $brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>'; |
|
| 768 | + $brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>'; |
|
| 772 | 769 | $brut_sql .= '<p>'; |
| 773 | 770 | foreach ($retours_sql as $key => $val) { |
| 774 | - $brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; |
|
| 771 | + $brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n"; |
|
| 775 | 772 | } |
| 776 | 773 | $brut_sql .= '</p>'; |
| 777 | 774 | } |
@@ -782,14 +779,14 @@ discard block |
||
| 782 | 779 | // ne pas afficher les $contexte_inclus |
| 783 | 780 | $view = preg_replace(',<\?php.+\?[>],Uims', '', $view); |
| 784 | 781 | if ($view) { |
| 785 | - $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>'; |
|
| 782 | + $res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>'; |
|
| 786 | 783 | } |
| 787 | 784 | } |
| 788 | 785 | } elseif ($affiche == 'code') { |
| 789 | 786 | $legend = $nom; |
| 790 | - $res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>'); |
|
| 787 | + $res = ancre_texte('<'."?php\n".$quoi."\n?".'>'); |
|
| 791 | 788 | } elseif ($affiche == 'boucle') { |
| 792 | - $legend = _T('zbug_boucle') . ' ' . $nom; |
|
| 789 | + $legend = _T('zbug_boucle').' '.$nom; |
|
| 793 | 790 | // Le compilateur prefixe le nom des boucles par l'extension du fichier source. |
| 794 | 791 | $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : ''; |
| 795 | 792 | $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); |
@@ -807,23 +804,23 @@ discard block |
||
| 807 | 804 | include_spip('public/assembler'); // pour inclure_balise_dynamique |
| 808 | 805 | include_spip('inc/texte'); // pour corriger_typo |
| 809 | 806 | |
| 810 | - return _DOCTYPE_ECRIRE . |
|
| 811 | - html_lang_attributes() . |
|
| 812 | - "<head>\n<title>" . |
|
| 813 | - ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' . |
|
| 814 | - _T('admin_debug') . ' ' . $titre . ' (' . |
|
| 815 | - supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) . |
|
| 816 | - ")</title>\n" . |
|
| 817 | - "<meta http-equiv='Content-Type' content='text/html" . |
|
| 818 | - (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') . |
|
| 819 | - "' />\n" . |
|
| 807 | + return _DOCTYPE_ECRIRE. |
|
| 808 | + html_lang_attributes(). |
|
| 809 | + "<head>\n<title>". |
|
| 810 | + ('SPIP '.$GLOBALS['spip_version_affichee'].' '. |
|
| 811 | + _T('admin_debug').' '.$titre.' ('. |
|
| 812 | + supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))). |
|
| 813 | + ")</title>\n". |
|
| 814 | + "<meta http-equiv='Content-Type' content='text/html". |
|
| 815 | + (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''). |
|
| 816 | + "' />\n". |
|
| 820 | 817 | http_script('', 'jquery.js') |
| 821 | - . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css')) |
|
| 822 | - . "' type='text/css' />" . |
|
| 823 | - "</head>\n" . |
|
| 824 | - "<body style='margin:0 10px;'>\n" . |
|
| 825 | - "<div id='spip-debug-header'>" . |
|
| 826 | - $corps . |
|
| 827 | - inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) . |
|
| 818 | + . "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) |
|
| 819 | + . "' type='text/css' />". |
|
| 820 | + "</head>\n". |
|
| 821 | + "<body style='margin:0 10px;'>\n". |
|
| 822 | + "<div id='spip-debug-header'>". |
|
| 823 | + $corps. |
|
| 824 | + inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false). |
|
| 828 | 825 | '</div></body></html>'; |
| 829 | 826 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $md5args = md5($arguments); |
| 71 | 71 | |
| 72 | 72 | // si pas de date programee, des que possible |
| 73 | - $duplicate_where = 'status=' . intval(_JQ_SCHEDULED) . ' AND '; |
|
| 73 | + $duplicate_where = 'status='.intval(_JQ_SCHEDULED).' AND '; |
|
| 74 | 74 | if (!$time) { |
| 75 | 75 | $time = time(); |
| 76 | 76 | $duplicate_where = ''; // ne pas dupliquer si deja le meme job en cours d'execution |
@@ -96,9 +96,8 @@ discard block |
||
| 96 | 96 | 'id_job', |
| 97 | 97 | 'spip_jobs', |
| 98 | 98 | $duplicate_where = |
| 99 | - $duplicate_where . 'fonction=' . sql_quote($function) |
|
| 100 | - . (($no_duplicate === 'function_only') ? '' : |
|
| 101 | - ' AND md5args=' . sql_quote($md5args) . ' AND inclure=' . sql_quote($file)) |
|
| 99 | + $duplicate_where.'fonction='.sql_quote($function) |
|
| 100 | + . (($no_duplicate === 'function_only') ? '' : ' AND md5args='.sql_quote($md5args).' AND inclure='.sql_quote($file)) |
|
| 102 | 101 | ) |
| 103 | 102 | ) { |
| 104 | 103 | return $id_job; |
@@ -111,9 +110,9 @@ discard block |
||
| 111 | 110 | if ( |
| 112 | 111 | $no_duplicate |
| 113 | 112 | and |
| 114 | - $id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<' . intval($id_job) . " AND $duplicate_where") |
|
| 113 | + $id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<'.intval($id_job)." AND $duplicate_where") |
|
| 115 | 114 | ) { |
| 116 | - sql_delete('spip_jobs', 'id_job=' . intval($id_job)); |
|
| 115 | + sql_delete('spip_jobs', 'id_job='.intval($id_job)); |
|
| 117 | 116 | |
| 118 | 117 | return $id_prev; |
| 119 | 118 | } |
@@ -125,9 +124,9 @@ discard block |
||
| 125 | 124 | // ie cas d'un char non acceptables sur certains type de champs |
| 126 | 125 | // qui coupe la valeur |
| 127 | 126 | if (defined('_JQ_INSERT_CHECK_ARGS') and $id_job) { |
| 128 | - $args = sql_getfetsel('args', 'spip_jobs', 'id_job=' . intval($id_job)); |
|
| 127 | + $args = sql_getfetsel('args', 'spip_jobs', 'id_job='.intval($id_job)); |
|
| 129 | 128 | if ($args !== $arguments) { |
| 130 | - spip_log('arguments job errones / longueur ' . strlen($args) . ' vs ' . strlen($arguments) . ' / valeur : ' . var_export( |
|
| 129 | + spip_log('arguments job errones / longueur '.strlen($args).' vs '.strlen($arguments).' / valeur : '.var_export( |
|
| 131 | 130 | $arguments, |
| 132 | 131 | true |
| 133 | 132 | ), 'queue'); |
@@ -157,7 +156,7 @@ discard block |
||
| 157 | 156 | function queue_purger() { |
| 158 | 157 | include_spip('base/abstract_sql'); |
| 159 | 158 | sql_delete('spip_jobs'); |
| 160 | - sql_delete('spip_jobs_liens', 'id_job NOT IN (' . sql_get_select('id_job', 'spip_jobs') . ')'); |
|
| 159 | + sql_delete('spip_jobs_liens', 'id_job NOT IN ('.sql_get_select('id_job', 'spip_jobs').')'); |
|
| 161 | 160 | include_spip('inc/genie'); |
| 162 | 161 | genie_queue_watch_dist(); |
| 163 | 162 | } |
@@ -173,8 +172,8 @@ discard block |
||
| 173 | 172 | include_spip('base/abstract_sql'); |
| 174 | 173 | |
| 175 | 174 | if ( |
| 176 | - $row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job=' . intval($id_job)) |
|
| 177 | - and $res = sql_delete('spip_jobs', 'id_job=' . intval($id_job)) |
|
| 175 | + $row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job='.intval($id_job)) |
|
| 176 | + and $res = sql_delete('spip_jobs', 'id_job='.intval($id_job)) |
|
| 178 | 177 | ) { |
| 179 | 178 | queue_unlink_job($id_job); |
| 180 | 179 | // est-ce une tache cron qu'il faut relancer ? |
@@ -224,7 +223,7 @@ discard block |
||
| 224 | 223 | * resultat du sql_delete |
| 225 | 224 | */ |
| 226 | 225 | function queue_unlink_job($id_job) { |
| 227 | - return sql_delete('spip_jobs_liens', 'id_job=' . intval($id_job)); |
|
| 226 | + return sql_delete('spip_jobs_liens', 'id_job='.intval($id_job)); |
|
| 228 | 227 | } |
| 229 | 228 | |
| 230 | 229 | /** |
@@ -240,7 +239,7 @@ discard block |
||
| 240 | 239 | // deserialiser les arguments |
| 241 | 240 | $args = unserialize($row['args']); |
| 242 | 241 | if (!is_array($args)) { |
| 243 | - spip_log('arguments job errones ' . var_export($row, true), 'queue'); |
|
| 242 | + spip_log('arguments job errones '.var_export($row, true), 'queue'); |
|
| 244 | 243 | $args = []; |
| 245 | 244 | } |
| 246 | 245 | |
@@ -257,14 +256,14 @@ discard block |
||
| 257 | 256 | } |
| 258 | 257 | |
| 259 | 258 | if (!function_exists($fonction)) { |
| 260 | - spip_log("fonction $fonction ($inclure) inexistante " . var_export($row, true), 'queue'); |
|
| 259 | + spip_log("fonction $fonction ($inclure) inexistante ".var_export($row, true), 'queue'); |
|
| 261 | 260 | |
| 262 | 261 | return false; |
| 263 | 262 | } |
| 264 | 263 | |
| 265 | - spip_log('queue [' . $row['id_job'] . "]: $fonction() start", 'queue'); |
|
| 264 | + spip_log('queue ['.$row['id_job']."]: $fonction() start", 'queue'); |
|
| 266 | 265 | $res = $fonction(...$args); |
| 267 | - spip_log('queue [' . $row['id_job'] . "]: $fonction() end", 'queue'); |
|
| 266 | + spip_log('queue ['.$row['id_job']."]: $fonction() end", 'queue'); |
|
| 268 | 267 | |
| 269 | 268 | return $res; |
| 270 | 269 | } |
@@ -295,14 +294,14 @@ discard block |
||
| 295 | 294 | function queue_schedule($force_jobs = null) { |
| 296 | 295 | $time = time(); |
| 297 | 296 | if (defined('_DEBUG_BLOCK_QUEUE')) { |
| 298 | - spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq' . _LOG_DEBUG); |
|
| 297 | + spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq'._LOG_DEBUG); |
|
| 299 | 298 | |
| 300 | 299 | return; |
| 301 | 300 | } |
| 302 | 301 | |
| 303 | 302 | // rien a faire si le prochain job est encore dans le futur |
| 304 | 303 | if (queue_sleep_time_to_next_job() > 0 and (!$force_jobs or !count($force_jobs))) { |
| 305 | - spip_log('queue_sleep_time_to_next_job', 'jq' . _LOG_DEBUG); |
|
| 304 | + spip_log('queue_sleep_time_to_next_job', 'jq'._LOG_DEBUG); |
|
| 306 | 305 | |
| 307 | 306 | return; |
| 308 | 307 | } |
@@ -323,7 +322,7 @@ discard block |
||
| 323 | 322 | } |
| 324 | 323 | $end_time = $time + _JQ_MAX_JOBS_TIME_TO_EXECUTE; |
| 325 | 324 | |
| 326 | - spip_log("JQ schedule $time / $end_time", 'jq' . _LOG_DEBUG); |
|
| 325 | + spip_log("JQ schedule $time / $end_time", 'jq'._LOG_DEBUG); |
|
| 327 | 326 | |
| 328 | 327 | if (!defined('_JQ_MAX_JOBS_EXECUTE')) { |
| 329 | 328 | define('_JQ_MAX_JOBS_EXECUTE', 200); |
@@ -337,19 +336,19 @@ discard block |
||
| 337 | 336 | // lorsqu'un job cron n'a pas fini, sa priorite est descendue |
| 338 | 337 | // pour qu'il ne bloque pas les autres jobs en attente |
| 339 | 338 | if (is_array($force_jobs) and count($force_jobs)) { |
| 340 | - $cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND ' . sql_in('id_job', $force_jobs); |
|
| 339 | + $cond = 'status='.intval(_JQ_SCHEDULED).' AND '.sql_in('id_job', $force_jobs); |
|
| 341 | 340 | } else { |
| 342 | 341 | $now = date('Y-m-d H:i:s', $time); |
| 343 | - $cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND date<=' . sql_quote($now); |
|
| 342 | + $cond = 'status='.intval(_JQ_SCHEDULED).' AND date<='.sql_quote($now); |
|
| 344 | 343 | } |
| 345 | 344 | |
| 346 | 345 | register_shutdown_function('queue_error_handler'); // recuperer les erreurs auant que possible |
| 347 | - $res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,' . (_JQ_MAX_JOBS_EXECUTE + 1)); |
|
| 346 | + $res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,'.(_JQ_MAX_JOBS_EXECUTE + 1)); |
|
| 348 | 347 | do { |
| 349 | 348 | if ($row = array_shift($res)) { |
| 350 | 349 | $nbj++; |
| 351 | 350 | // il faut un verrou, a base de sql_delete |
| 352 | - if (sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']) . ' AND status=' . intval(_JQ_SCHEDULED))) { |
|
| 351 | + if (sql_delete('spip_jobs', 'id_job='.intval($row['id_job']).' AND status='.intval(_JQ_SCHEDULED))) { |
|
| 353 | 352 | #spip_log("JQ schedule job ".$nbj." OK",'jq'); |
| 354 | 353 | // on reinsert dans la base aussitot avec un status=_JQ_PENDING |
| 355 | 354 | $row['status'] = _JQ_PENDING; |
@@ -364,13 +363,13 @@ discard block |
||
| 364 | 363 | queue_close_job($row, $time, $result); |
| 365 | 364 | } |
| 366 | 365 | } |
| 367 | - spip_log('JQ schedule job end time ' . $time, 'jq' . _LOG_DEBUG); |
|
| 366 | + spip_log('JQ schedule job end time '.$time, 'jq'._LOG_DEBUG); |
|
| 368 | 367 | } while ($nbj < _JQ_MAX_JOBS_EXECUTE and $row and $time < $end_time); |
| 369 | - spip_log('JQ schedule end time ' . time(), 'jq' . _LOG_DEBUG); |
|
| 368 | + spip_log('JQ schedule end time '.time(), 'jq'._LOG_DEBUG); |
|
| 370 | 369 | |
| 371 | 370 | if ($row = array_shift($res)) { |
| 372 | 371 | queue_update_next_job_time(0); // on sait qu'il y a encore des jobs a lancer ASAP |
| 373 | - spip_log('JQ encore !', 'jq' . _LOG_DEBUG); |
|
| 372 | + spip_log('JQ encore !', 'jq'._LOG_DEBUG); |
|
| 374 | 373 | } else { |
| 375 | 374 | queue_update_next_job_time(); |
| 376 | 375 | } |
@@ -405,9 +404,9 @@ discard block |
||
| 405 | 404 | } |
| 406 | 405 | } |
| 407 | 406 | // purger ses liens eventuels avec des objets |
| 408 | - sql_delete('spip_jobs_liens', 'id_job=' . intval($row['id_job'])); |
|
| 407 | + sql_delete('spip_jobs_liens', 'id_job='.intval($row['id_job'])); |
|
| 409 | 408 | // supprimer le job fini |
| 410 | - sql_delete('spip_jobs', 'id_job=' . intval($row['id_job'])); |
|
| 409 | + sql_delete('spip_jobs', 'id_job='.intval($row['id_job'])); |
|
| 411 | 410 | } |
| 412 | 411 | |
| 413 | 412 | /** |
@@ -480,18 +479,18 @@ discard block |
||
| 480 | 479 | $res = sql_allfetsel( |
| 481 | 480 | '*', |
| 482 | 481 | 'spip_jobs', |
| 483 | - 'status=' . intval(_JQ_PENDING) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time - 180)) |
|
| 482 | + 'status='.intval(_JQ_PENDING).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time - 180)) |
|
| 484 | 483 | ); |
| 485 | 484 | if (is_array($res)) { |
| 486 | 485 | foreach ($res as $row) { |
| 487 | 486 | queue_close_job($row, $time); |
| 488 | - spip_log('queue_close_job car _JQ_PENDING depuis +180s : ' . print_r($row, 1), 'job_mort' . _LOG_ERREUR); |
|
| 487 | + spip_log('queue_close_job car _JQ_PENDING depuis +180s : '.print_r($row, 1), 'job_mort'._LOG_ERREUR); |
|
| 489 | 488 | } |
| 490 | 489 | } |
| 491 | 490 | |
| 492 | 491 | // chercher la date du prochain job si pas connu |
| 493 | 492 | if (is_null($next) or is_null(queue_sleep_time_to_next_job())) { |
| 494 | - $date = sql_getfetsel('date', 'spip_jobs', 'status=' . intval(_JQ_SCHEDULED), '', 'date', '0,1'); |
|
| 493 | + $date = sql_getfetsel('date', 'spip_jobs', 'status='.intval(_JQ_SCHEDULED), '', 'date', '0,1'); |
|
| 495 | 494 | $next = strtotime($date); |
| 496 | 495 | } |
| 497 | 496 | if (!is_null($next_time)) { |
@@ -504,7 +503,7 @@ discard block |
||
| 504 | 503 | if (is_null($nb_jobs_scheduled)) { |
| 505 | 504 | $nb_jobs_scheduled = sql_countsel( |
| 506 | 505 | 'spip_jobs', |
| 507 | - 'status=' . intval(_JQ_SCHEDULED) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time)) |
|
| 506 | + 'status='.intval(_JQ_SCHEDULED).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time)) |
|
| 508 | 507 | ); |
| 509 | 508 | } elseif ($next <= $time) { |
| 510 | 509 | $nb_jobs_scheduled++; |
@@ -573,7 +572,7 @@ discard block |
||
| 573 | 572 | } |
| 574 | 573 | |
| 575 | 574 | // ne pas relancer si on vient de lancer dans la meme seconde par un hit concurent |
| 576 | - if (file_exists($lock = _DIR_TMP . 'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) { |
|
| 575 | + if (file_exists($lock = _DIR_TMP.'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) { |
|
| 577 | 576 | return $texte; |
| 578 | 577 | } |
| 579 | 578 | |
@@ -645,7 +644,7 @@ discard block |
||
| 645 | 644 | $port = 80; |
| 646 | 645 | } |
| 647 | 646 | $fp = @fsockopen( |
| 648 | - $scheme . $parts['host'], |
|
| 647 | + $scheme.$parts['host'], |
|
| 649 | 648 | $parts['port'] ?? $port, |
| 650 | 649 | $errno, |
| 651 | 650 | $errstr, |
@@ -655,13 +654,13 @@ discard block |
||
| 655 | 654 | if ($fp) { |
| 656 | 655 | $host_sent = $parts['host']; |
| 657 | 656 | if (isset($parts['port']) and $parts['port'] !== $port) { |
| 658 | - $host_sent .= ':' . $parts['port']; |
|
| 657 | + $host_sent .= ':'.$parts['port']; |
|
| 659 | 658 | } |
| 660 | 659 | $timeout = 200; // ms |
| 661 | 660 | stream_set_timeout($fp, 0, $timeout * 1000); |
| 662 | - $query = $parts['path'] . ($parts['query'] ? '?' . $parts['query'] : ''); |
|
| 663 | - $out = 'GET ' . $query . " HTTP/1.1\r\n"; |
|
| 664 | - $out .= 'Host: ' . $host_sent . "\r\n"; |
|
| 661 | + $query = $parts['path'].($parts['query'] ? '?'.$parts['query'] : ''); |
|
| 662 | + $out = 'GET '.$query." HTTP/1.1\r\n"; |
|
| 663 | + $out .= 'Host: '.$host_sent."\r\n"; |
|
| 665 | 664 | $out .= "Connection: Close\r\n\r\n"; |
| 666 | 665 | fwrite($fp, $out); |
| 667 | 666 | spip_timer('read'); |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | function balise_DOSSIER_SQUELETTE_dist($p) { |
| 360 | 360 | $code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE)); |
| 361 | - $p->code = "_DIR_RACINE . '$code'" . |
|
| 361 | + $p->code = "_DIR_RACINE . '$code'". |
|
| 362 | 362 | $p->interdire_scripts = false; |
| 363 | 363 | |
| 364 | 364 | return $p; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | function balise_SQUELETTE_dist($p) { |
| 379 | 379 | $code = addslashes($p->descr['sourcefile']); |
| 380 | - $p->code = "'$code'" . |
|
| 380 | + $p->code = "'$code'". |
|
| 381 | 381 | $p->interdire_scripts = false; |
| 382 | 382 | |
| 383 | 383 | return $p; |
@@ -429,9 +429,9 @@ discard block |
||
| 429 | 429 | **/ |
| 430 | 430 | function balise_NOM_SITE_dist($p) { |
| 431 | 431 | if (!$p->etoile) { |
| 432 | - $p->code = 'supprimer_numero(calculer_url(' . |
|
| 433 | - champ_sql('url_site', $p) . ',' . |
|
| 434 | - champ_sql('nom_site', $p) . |
|
| 432 | + $p->code = 'supprimer_numero(calculer_url('. |
|
| 433 | + champ_sql('url_site', $p).','. |
|
| 434 | + champ_sql('nom_site', $p). |
|
| 435 | 435 | ", 'titre', \$connect, false))"; |
| 436 | 436 | } else { |
| 437 | 437 | $p->code = champ_sql('nom_site', $p); |
@@ -582,8 +582,8 @@ discard block |
||
| 582 | 582 | * Pile complétée par le code à générer |
| 583 | 583 | **/ |
| 584 | 584 | function balise_POPULARITE_ABSOLUE_dist($p) { |
| 585 | - $p->code = 'ceil(' . |
|
| 586 | - champ_sql('popularite', $p) . |
|
| 585 | + $p->code = 'ceil('. |
|
| 586 | + champ_sql('popularite', $p). |
|
| 587 | 587 | ')'; |
| 588 | 588 | $p->interdire_scripts = false; |
| 589 | 589 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b); |
| 665 | 665 | ; |
| 666 | 666 | if (($v = interprete_argument_balise(1, $p)) !== null) { |
| 667 | - $p->code = 'table_valeur(' . $p->code . ', ' . $v . ')'; |
|
| 667 | + $p->code = 'table_valeur('.$p->code.', '.$v.')'; |
|
| 668 | 668 | } |
| 669 | 669 | $p->interdire_scripts = true; |
| 670 | 670 | |
@@ -804,16 +804,16 @@ discard block |
||
| 804 | 804 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 805 | 805 | if ($desc = $trouver_table(table_objet_sql($type_objet))) { |
| 806 | 806 | if (isset($desc['field']['descriptif'])) { |
| 807 | - $_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ','; |
|
| 807 | + $_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).','; |
|
| 808 | 808 | } |
| 809 | 809 | if (isset($desc['field']['texte'])) { |
| 810 | - $_ligne .= "'texte' => " . champ_sql('texte', $p) . ','; |
|
| 810 | + $_ligne .= "'texte' => ".champ_sql('texte', $p).','; |
|
| 811 | 811 | } |
| 812 | 812 | if (isset($desc['field']['chapo'])) { |
| 813 | - $_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ','; |
|
| 813 | + $_ligne .= "'chapo' => ".champ_sql('chapo', $p).','; |
|
| 814 | 814 | } |
| 815 | 815 | if (isset($desc['introduction_longueur'])) { |
| 816 | - $_introduction_longueur = "'" . $desc['introduction_longueur'] . "'"; |
|
| 816 | + $_introduction_longueur = "'".$desc['introduction_longueur']."'"; |
|
| 817 | 817 | } |
| 818 | 818 | } |
| 819 | 819 | $_ligne .= ')'; |
@@ -909,10 +909,10 @@ discard block |
||
| 909 | 909 | $p->code = sprintf( |
| 910 | 910 | CODE_RECUPERER_FOND, |
| 911 | 911 | "'modeles/lesauteurs'", |
| 912 | - "array('objet'=>'" . $objet . |
|
| 913 | - "','id_objet' => " . champ_sql($id_table_objet, $p) . |
|
| 914 | - ",'$id_table_objet' => " . champ_sql($id_table_objet, $p) . |
|
| 915 | - ($objet == 'article' ? '' : ",'id_article' => " . champ_sql('id_article', $p)) . |
|
| 912 | + "array('objet'=>'".$objet. |
|
| 913 | + "','id_objet' => ".champ_sql($id_table_objet, $p). |
|
| 914 | + ",'$id_table_objet' => ".champ_sql($id_table_objet, $p). |
|
| 915 | + ($objet == 'article' ? '' : ",'id_article' => ".champ_sql('id_article', $p)). |
|
| 916 | 916 | ')', |
| 917 | 917 | "'trim'=>true, 'compil'=>array($c)", |
| 918 | 918 | _q($connect) |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | $m = trim($m); |
| 982 | 982 | if ($m != "''") { |
| 983 | 983 | if (!preg_match(',\W,', $m)) { |
| 984 | - $m = $boucle->id_table . ".$m"; |
|
| 984 | + $m = $boucle->id_table.".$m"; |
|
| 985 | 985 | } |
| 986 | 986 | |
| 987 | 987 | $m .= ' AS titre_rang'; |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | $f_pagination = chercher_filtre('pagination'); |
| 1143 | 1143 | $type = $p->boucles[$b]->modificateur['debut_nom']; |
| 1144 | 1144 | $modif = ($type[0] !== "'") ? "'debut'.$type" |
| 1145 | - : ("'debut" . substr($type, 1)); |
|
| 1145 | + : ("'debut".substr($type, 1)); |
|
| 1146 | 1146 | |
| 1147 | 1147 | $p->code = sprintf( |
| 1148 | 1148 | CODE_PAGINATION, |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | $msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN']]; |
| 1286 | 1286 | erreur_squelette($msg, $p); |
| 1287 | 1287 | } else { |
| 1288 | - $p->code = 'find_in_path((string)' . $arg . ')'; |
|
| 1288 | + $p->code = 'find_in_path((string)'.$arg.')'; |
|
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | $p->interdire_scripts = false; |
@@ -1320,7 +1320,7 @@ discard block |
||
| 1320 | 1320 | $msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN_IMAGE']]; |
| 1321 | 1321 | erreur_squelette($msg, $p); |
| 1322 | 1322 | } else { |
| 1323 | - $p->code = 'chemin_image((string)' . $arg . ')'; |
|
| 1323 | + $p->code = 'chemin_image((string)'.$arg.')'; |
|
| 1324 | 1324 | } |
| 1325 | 1325 | |
| 1326 | 1326 | $p->interdire_scripts = false; |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | // cas de #ENV sans argument : on retourne le serialize() du tableau |
| 1375 | 1375 | // une belle fonction [(#ENV|affiche_env)] serait pratique |
| 1376 | 1376 | if ($src) { |
| 1377 | - $p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")'; |
|
| 1377 | + $p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")'; |
|
| 1378 | 1378 | } else { |
| 1379 | 1379 | $p->code = 'serialize($Pile[0]??[])'; |
| 1380 | 1380 | } |
@@ -1427,8 +1427,8 @@ discard block |
||
| 1427 | 1427 | $_sinon = interprete_argument_balise(2, $p); |
| 1428 | 1428 | $_unserialize = sinon(interprete_argument_balise(3, $p), 'false'); |
| 1429 | 1429 | |
| 1430 | - $p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' . |
|
| 1431 | - ($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')"; |
|
| 1430 | + $p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','. |
|
| 1431 | + ($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')"; |
|
| 1432 | 1432 | |
| 1433 | 1433 | return $p; |
| 1434 | 1434 | } |
@@ -1521,7 +1521,7 @@ discard block |
||
| 1521 | 1521 | $err_b_s_a = ['zbug_balise_sans_argument', ['balise' => 'SESSION_SET']]; |
| 1522 | 1522 | erreur_squelette($err_b_s_a, $p); |
| 1523 | 1523 | } else { |
| 1524 | - $p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))'; |
|
| 1524 | + $p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))'; |
|
| 1525 | 1525 | } |
| 1526 | 1526 | |
| 1527 | 1527 | $p->interdire_scripts = false; |
@@ -1569,7 +1569,7 @@ discard block |
||
| 1569 | 1569 | ) |
| 1570 | 1570 | ) { |
| 1571 | 1571 | $p->code = /* $r[1]. */ |
| 1572 | - '(' . $r[2] . ')'; |
|
| 1572 | + '('.$r[2].')'; |
|
| 1573 | 1573 | } else { |
| 1574 | 1574 | $p->code = "eval('return '.$php.';')"; |
| 1575 | 1575 | } |
@@ -1813,9 +1813,9 @@ discard block |
||
| 1813 | 1813 | |
| 1814 | 1814 | // noter la duree du cache dans un entete proprietaire |
| 1815 | 1815 | |
| 1816 | - $code = "'<'.'" . '?php header("X-Spip-Cache: ' |
|
| 1816 | + $code = "'<'.'".'?php header("X-Spip-Cache: ' |
|
| 1817 | 1817 | . $duree |
| 1818 | - . '"); ?' . "'.'>'"; |
|
| 1818 | + . '"); ?'."'.'>'"; |
|
| 1819 | 1819 | |
| 1820 | 1820 | // Remplir le header Cache-Control |
| 1821 | 1821 | // cas #CACHE{0} |
@@ -1836,9 +1836,9 @@ discard block |
||
| 1836 | 1836 | $pa == 'cache-client' |
| 1837 | 1837 | and $duree > 0 |
| 1838 | 1838 | ) { |
| 1839 | - $code .= ".'<'.'" . '?php header("Cache-Control: max-age=' |
|
| 1839 | + $code .= ".'<'.'".'?php header("Cache-Control: max-age=' |
|
| 1840 | 1840 | . $duree |
| 1841 | - . '"); ?' . "'.'>'"; |
|
| 1841 | + . '"); ?'."'.'>'"; |
|
| 1842 | 1842 | // il semble logique, si on cache-client, de ne pas invalider |
| 1843 | 1843 | $pa = 'statique'; |
| 1844 | 1844 | } |
@@ -1847,7 +1847,7 @@ discard block |
||
| 1847 | 1847 | $pa == 'statique' |
| 1848 | 1848 | and $duree > 0 |
| 1849 | 1849 | ) { |
| 1850 | - $code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'"; |
|
| 1850 | + $code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'"; |
|
| 1851 | 1851 | } |
| 1852 | 1852 | } |
| 1853 | 1853 | } else { |
@@ -2011,9 +2011,9 @@ discard block |
||
| 2011 | 2011 | if ($p->etoile) { |
| 2012 | 2012 | $_options[] = "'etoile'=>true"; |
| 2013 | 2013 | } |
| 2014 | - $_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ')'; |
|
| 2014 | + $_options[] = "'compil'=>array(".memoriser_contexte_compil($p).')'; |
|
| 2015 | 2015 | |
| 2016 | - $_l = 'array(' . join(",\n\t", $_contexte) . ')'; |
|
| 2016 | + $_l = 'array('.join(",\n\t", $_contexte).')'; |
|
| 2017 | 2017 | if ($flag_env) { |
| 2018 | 2018 | $_l = "array_merge(\$Pile[0],$_l)"; |
| 2019 | 2019 | } |
@@ -2023,7 +2023,7 @@ discard block |
||
| 2023 | 2023 | $msg = ['zbug_balise_sans_argument', ['balise' => ' INCLURE']]; |
| 2024 | 2024 | erreur_squelette($msg, $p); |
| 2025 | 2025 | } else { |
| 2026 | - $p->code = 'charge_scripts(' . $_contexte[1] . ',false)'; |
|
| 2026 | + $p->code = 'charge_scripts('.$_contexte[1].',false)'; |
|
| 2027 | 2027 | } |
| 2028 | 2028 | |
| 2029 | 2029 | $p->interdire_scripts = false; // la securite est assuree par recuperer_fond |
@@ -2071,7 +2071,7 @@ discard block |
||
| 2071 | 2071 | unset($_contexte[1]); |
| 2072 | 2072 | |
| 2073 | 2073 | if (preg_match("/^\s*'[^']*'/s", $nom)) { |
| 2074 | - $nom = "'modeles/" . substr($nom, 1); |
|
| 2074 | + $nom = "'modeles/".substr($nom, 1); |
|
| 2075 | 2075 | } else { |
| 2076 | 2076 | $nom = "'modeles/' . $nom"; |
| 2077 | 2077 | } |
@@ -2088,8 +2088,8 @@ discard block |
||
| 2088 | 2088 | $primary = $p->boucles[$p->id_boucle]->primary; |
| 2089 | 2089 | if (!strpos($primary, ',')) { |
| 2090 | 2090 | $id = champ_sql($primary, $p); |
| 2091 | - $_contexte[] = "'$primary'=>" . $id; |
|
| 2092 | - $_contexte[] = "'id'=>" . $id; |
|
| 2091 | + $_contexte[] = "'$primary'=>".$id; |
|
| 2092 | + $_contexte[] = "'id'=>".$id; |
|
| 2093 | 2093 | } |
| 2094 | 2094 | } |
| 2095 | 2095 | $_contexte[] = "'recurs'=>(++\$recurs)"; |
@@ -2101,11 +2101,11 @@ discard block |
||
| 2101 | 2101 | $_options = memoriser_contexte_compil($p); |
| 2102 | 2102 | $_options = "'compil'=>array($_options), 'trim'=>true"; |
| 2103 | 2103 | if (isset($_contexte['ajax'])) { |
| 2104 | - $_options .= ', ' . preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']); |
|
| 2104 | + $_options .= ', '.preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']); |
|
| 2105 | 2105 | unset($_contexte['ajax']); |
| 2106 | 2106 | } |
| 2107 | 2107 | |
| 2108 | - $_l = 'array(' . join(",\n\t", $_contexte) . ')'; |
|
| 2108 | + $_l = 'array('.join(",\n\t", $_contexte).')'; |
|
| 2109 | 2109 | if ($flag_env) { |
| 2110 | 2110 | $_l = "array_merge(\$Pile[0],$_l)"; |
| 2111 | 2111 | } |
@@ -2215,12 +2215,12 @@ discard block |
||
| 2215 | 2215 | function balise_DOUBLONS_dist($p) { |
| 2216 | 2216 | if ($type = interprete_argument_balise(1, $p)) { |
| 2217 | 2217 | if ($famille = interprete_argument_balise(2, $p)) { |
| 2218 | - $type .= '.' . $famille; |
|
| 2218 | + $type .= '.'.$famille; |
|
| 2219 | 2219 | } |
| 2220 | - $p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")'; |
|
| 2220 | + $p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")'; |
|
| 2221 | 2221 | if (!$p->etoile) { |
| 2222 | 2222 | $p->code = 'array_filter(array_map("intval",explode(",",' |
| 2223 | - . $p->code . ')))'; |
|
| 2223 | + . $p->code.')))'; |
|
| 2224 | 2224 | } |
| 2225 | 2225 | } else { |
| 2226 | 2226 | $p->code = '$doublons'; |
@@ -2349,7 +2349,7 @@ discard block |
||
| 2349 | 2349 | $_code[] = "$_key => $_val"; |
| 2350 | 2350 | } |
| 2351 | 2351 | } while ($_key && $_val); |
| 2352 | - $p->code = 'array(' . join(', ', $_code) . ')'; |
|
| 2352 | + $p->code = 'array('.join(', ', $_code).')'; |
|
| 2353 | 2353 | $p->interdire_scripts = false; |
| 2354 | 2354 | |
| 2355 | 2355 | return $p; |
@@ -2376,7 +2376,7 @@ discard block |
||
| 2376 | 2376 | while ($_val = interprete_argument_balise($n++, $p)) { |
| 2377 | 2377 | $_code[] = $_val; |
| 2378 | 2378 | } |
| 2379 | - $p->code = 'array(' . join(', ', $_code) . ')'; |
|
| 2379 | + $p->code = 'array('.join(', ', $_code).')'; |
|
| 2380 | 2380 | $p->interdire_scripts = false; |
| 2381 | 2381 | |
| 2382 | 2382 | return $p; |
@@ -2421,10 +2421,10 @@ discard block |
||
| 2421 | 2421 | $_code[] = $_v; |
| 2422 | 2422 | } |
| 2423 | 2423 | |
| 2424 | - $p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join( |
|
| 2424 | + $p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join( |
|
| 2425 | 2425 | ', ', |
| 2426 | 2426 | $_code |
| 2427 | - ) . ')?" ":"")'; |
|
| 2427 | + ).')?" ":"")'; |
|
| 2428 | 2428 | $p->interdire_scripts = false; |
| 2429 | 2429 | |
| 2430 | 2430 | return $p; |
@@ -2457,7 +2457,7 @@ discard block |
||
| 2457 | 2457 | $type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"'; |
| 2458 | 2458 | |
| 2459 | 2459 | $f = chercher_filtre('info_plugin'); |
| 2460 | - $p->code = $f . '(' . $plugin . ', ' . $type_info . ')'; |
|
| 2460 | + $p->code = $f.'('.$plugin.', '.$type_info.')'; |
|
| 2461 | 2461 | |
| 2462 | 2462 | return $p; |
| 2463 | 2463 | } |
@@ -2709,12 +2709,12 @@ discard block |
||
| 2709 | 2709 | $_issens = "in_array($_champ,array('>','<'))"; |
| 2710 | 2710 | $_sens = "(strpos('< >',$_champ)-1)"; |
| 2711 | 2711 | |
| 2712 | - $_variable = "((\$s=$_issens)?'sens':'tri')." . $boucle->modificateur['tri_nom']; |
|
| 2712 | + $_variable = "((\$s=$_issens)?'sens':'tri').".$boucle->modificateur['tri_nom']; |
|
| 2713 | 2713 | $_url = "parametre_url(self(),$_variable,\$s?$_sens:$_champ)"; |
| 2714 | - $_url = "parametre_url($_url,'var_memotri',strncmp(" . $boucle->modificateur['tri_nom'] . ",'session',7)==0?$_variable:'')"; |
|
| 2715 | - $_on = '$s?(' . $boucle->modificateur['tri_sens'] . "==$_sens" . '):(' . $boucle->modificateur['tri_champ'] . "==$_champ)"; |
|
| 2714 | + $_url = "parametre_url($_url,'var_memotri',strncmp(".$boucle->modificateur['tri_nom'].",'session',7)==0?$_variable:'')"; |
|
| 2715 | + $_on = '$s?('.$boucle->modificateur['tri_sens']."==$_sens".'):('.$boucle->modificateur['tri_champ']."==$_champ)"; |
|
| 2716 | 2716 | |
| 2717 | - $p->code = "lien_ou_expose($_url,$_libelle,$_on" . ($_class ? ",$_class" : '') . ')'; |
|
| 2717 | + $p->code = "lien_ou_expose($_url,$_libelle,$_on".($_class ? ",$_class" : '').')'; |
|
| 2718 | 2718 | //$p->code = "''"; |
| 2719 | 2719 | $p->interdire_scripts = false; |
| 2720 | 2720 | |
@@ -2787,7 +2787,7 @@ discard block |
||
| 2787 | 2787 | $connect = $p->boucles[$p->id_boucle]->sql_serveur; |
| 2788 | 2788 | } |
| 2789 | 2789 | |
| 2790 | - $p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')"; |
|
| 2790 | + $p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')"; |
|
| 2791 | 2791 | $p->interdire_scripts = false; |
| 2792 | 2792 | |
| 2793 | 2793 | return $p; |