@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | #if (!$sql_desc) $sql_desc = false; |
| 86 | 86 | #spip_log("Resultat table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE); |
| 87 | 87 | if (!$sql_desc) { |
| 88 | - spip_log("Echec creation table $table", "maj" . _LOG_CRITIQUE); |
|
| 88 | + spip_log("Echec creation table $table", "maj"._LOG_CRITIQUE); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | } else { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if (isset($desc['field'])) { |
| 98 | 98 | foreach ($desc['field'] as $field => $type) { |
| 99 | 99 | if (!isset($sql_desc['field'][$field])) { |
| 100 | - sql_alter("TABLE $table ADD $field $type" . ($last ? " AFTER $last" : ""), $serveur); |
|
| 100 | + sql_alter("TABLE $table ADD $field $type".($last ? " AFTER $last" : ""), $serveur); |
|
| 101 | 101 | } |
| 102 | 102 | $last = $field; |
| 103 | 103 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // Si a ce stade on n'a pas de table, il y a un bug |
| 232 | 232 | if (!is_array($this->tableau)) { |
| 233 | 233 | $this->err = true; |
| 234 | - spip_log("erreur datasource " . var_export($command, true)); |
|
| 234 | + spip_log("erreur datasource ".var_export($command, true)); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // {datapath query.results} |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | if (isset($this->command['sourcemode']) |
| 272 | 272 | and !in_array($this->command['sourcemode'], array('table', 'array', 'tableau')) |
| 273 | 273 | ) { |
| 274 | - charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true); |
|
| 274 | + charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | # le premier argument peut etre un array, une URL etc. |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | # avons-nous un cache dispo ? |
| 281 | 281 | $cle = null; |
| 282 | 282 | if (is_string($src)) { |
| 283 | - $cle = 'datasource_' . md5($this->command['sourcemode'] . ':' . var_export($this->command['source'], true)); |
|
| 283 | + $cle = 'datasource_'.md5($this->command['sourcemode'].':'.var_export($this->command['source'], true)); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | $cache = $this->cache_get($cle); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | if (!$this->err |
| 335 | - and $data_to_array = charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true) |
|
| 335 | + and $data_to_array = charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true) |
|
| 336 | 336 | ) { |
| 337 | 337 | $args = $this->command['source']; |
| 338 | 338 | $args[0] = $data; |
@@ -467,13 +467,13 @@ discard block |
||
| 467 | 467 | $tv = '%s'; |
| 468 | 468 | } # {par valeur/xx/yy} ?? |
| 469 | 469 | else { |
| 470 | - $tv = 'table_valeur(%s, ' . var_export($r[1], true) . ')'; |
|
| 470 | + $tv = 'table_valeur(%s, '.var_export($r[1], true).')'; |
|
| 471 | 471 | } |
| 472 | 472 | $sortfunc .= ' |
| 473 | - $a = ' . sprintf($tv, '$aa') . '; |
|
| 474 | - $b = ' . sprintf($tv, '$bb') . '; |
|
| 473 | + $a = ' . sprintf($tv, '$aa').'; |
|
| 474 | + $b = ' . sprintf($tv, '$bb').'; |
|
| 475 | 475 | if ($a <> $b) |
| 476 | - return ($a ' . (!empty($r[2]) ? '>' : '<') . ' $b) ? -1 : 1;'; |
|
| 476 | + return ($a ' . (!empty($r[2]) ? '>' : '<').' $b) ? -1 : 1;'; |
|
| 477 | 477 | } |
| 478 | 478 | } |
| 479 | 479 | } |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | function inc_sql_to_array_dist($data) { |
| 627 | 627 | # sortir le connecteur de $data |
| 628 | 628 | preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v); |
| 629 | - $serveur = (string)$v[1]; |
|
| 629 | + $serveur = (string) $v[1]; |
|
| 630 | 630 | $req = trim($v[2]); |
| 631 | 631 | if ($s = sql_query($req, $serveur)) { |
| 632 | 632 | $r = array(); |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | */ |
| 649 | 649 | function inc_json_to_array_dist($data) { |
| 650 | 650 | if (is_array($json = json_decode($data, true))) { |
| 651 | - return (array)$json; |
|
| 651 | + return (array) $json; |
|
| 652 | 652 | } |
| 653 | 653 | } |
| 654 | 654 | |
@@ -667,13 +667,13 @@ discard block |
||
| 667 | 667 | $i = 1; |
| 668 | 668 | foreach ($entete as $k => $v) { |
| 669 | 669 | if (trim($v) == "") { |
| 670 | - $v = "col" . $i; |
|
| 670 | + $v = "col".$i; |
|
| 671 | 671 | } // reperer des eventuelles cases vides |
| 672 | 672 | if (is_numeric($v) and $v < 0) { |
| 673 | - $v = "__" . $v; |
|
| 673 | + $v = "__".$v; |
|
| 674 | 674 | } // ne pas risquer d'ecraser une cle numerique |
| 675 | 675 | if (is_numeric($v)) { |
| 676 | - $v = "_" . $v; |
|
| 676 | + $v = "_".$v; |
|
| 677 | 677 | } // ne pas risquer d'ecraser une cle numerique |
| 678 | 678 | $v = strtolower(preg_replace(',\W+,', '_', translitteration($v))); |
| 679 | 679 | foreach ($csv as &$item) { |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | * @return array|bool |
| 758 | 758 | */ |
| 759 | 759 | function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) { |
| 760 | - return (array)preg_files($dir, $regexp, $limit); |
|
| 760 | + return (array) preg_files($dir, $regexp, $limit); |
|
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | /** |
@@ -772,13 +772,13 @@ discard block |
||
| 772 | 772 | $glob_to_array = charger_fonction('glob_to_array', 'inc'); |
| 773 | 773 | $a = $glob_to_array($data); |
| 774 | 774 | foreach ($a as &$v) { |
| 775 | - $b = (array)@stat($v); |
|
| 775 | + $b = (array) @stat($v); |
|
| 776 | 776 | foreach ($b as $k => $ignore) { |
| 777 | 777 | if (is_numeric($k)) { |
| 778 | 778 | unset($b[$k]); |
| 779 | 779 | } |
| 780 | 780 | } |
| 781 | - $b['file'] = preg_replace('`/$`','',$v) ; |
|
| 781 | + $b['file'] = preg_replace('`/$`', '', $v); |
|
| 782 | 782 | $v = array_merge( |
| 783 | 783 | pathinfo($v), |
| 784 | 784 | $b |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | $xml_array = array(); |
| 799 | 799 | for ($object->rewind(); $object->valid(); $object->next()) { |
| 800 | 800 | if (array_key_exists($key = $object->key(), $xml_array)) { |
| 801 | - $key .= '-' . uniqid(); |
|
| 801 | + $key .= '-'.uniqid(); |
|
| 802 | 802 | } |
| 803 | 803 | $vars = get_object_vars($object->current()); |
| 804 | 804 | if (isset($vars['@attributes'])) { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } else { |
| 44 | 44 | # Attention GD sait lire le gif mais pas forcement l'ecrire |
| 45 | 45 | if (function_exists('ImageCreateFromGIF')) { |
| 46 | - $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK . "test.gif"); |
|
| 46 | + $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK."test.gif"); |
|
| 47 | 47 | if ($srcImage) { |
| 48 | 48 | $gd_formats_read_gif = ",gif"; |
| 49 | 49 | ImageDestroy($srcImage); |
@@ -67,28 +67,28 @@ discard block |
||
| 67 | 67 | # les formats disponibles en ecriture... (cf. inc_logos) |
| 68 | 68 | |
| 69 | 69 | if (function_exists('ImageCreateFromJPEG')) { |
| 70 | - $srcImage = @ImageCreateFromJPEG(_ROOT_IMG_PACK . "test.jpg"); |
|
| 70 | + $srcImage = @ImageCreateFromJPEG(_ROOT_IMG_PACK."test.jpg"); |
|
| 71 | 71 | if ($srcImage) { |
| 72 | 72 | $gd_formats[] = "jpg"; |
| 73 | 73 | ImageDestroy($srcImage); |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | if (function_exists('ImageCreateFromGIF')) { |
| 77 | - $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK . "test.gif"); |
|
| 77 | + $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK."test.gif"); |
|
| 78 | 78 | if ($srcImage) { |
| 79 | 79 | $gd_formats[] = "gif"; |
| 80 | 80 | ImageDestroy($srcImage); |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | if (function_exists('ImageCreateFromPNG')) { |
| 84 | - $srcImage = @ImageCreateFromPNG(_ROOT_IMG_PACK . "test.png"); |
|
| 84 | + $srcImage = @ImageCreateFromPNG(_ROOT_IMG_PACK."test.png"); |
|
| 85 | 85 | if ($srcImage) { |
| 86 | 86 | $gd_formats[] = "png"; |
| 87 | 87 | ImageDestroy($srcImage); |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | if (function_exists('ImageCreateFromWEBP')) { |
| 91 | - $srcImage = @ImageCreateFromWEBP(_ROOT_IMG_PACK . "test.webp"); |
|
| 91 | + $srcImage = @ImageCreateFromWEBP(_ROOT_IMG_PACK."test.webp"); |
|
| 92 | 92 | if ($srcImage) { |
| 93 | 93 | $gd_formats[] = "webp"; |
| 94 | 94 | ImageDestroy($srcImage); |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (! empty($gd_formats)) { |
|
| 99 | + if (!empty($gd_formats)) { |
|
| 100 | 100 | $gd_formats = join(",", $gd_formats); |
| 101 | 101 | } |
| 102 | - ecrire_meta("gd_formats_read", $gd_formats . $gd_formats_read_gif); |
|
| 102 | + ecrire_meta("gd_formats_read", $gd_formats.$gd_formats_read_gif); |
|
| 103 | 103 | ecrire_meta("gd_formats", $gd_formats); |
| 104 | 104 | } // verifier les formats netpbm |
| 105 | 105 | else { |
@@ -117,9 +117,9 @@ discard block |
||
| 117 | 117 | $pnmtojpeg_command = str_replace("pnmscale", |
| 118 | 118 | "pnmtojpeg", _PNMSCALE_COMMAND); |
| 119 | 119 | |
| 120 | - $vignette = _ROOT_IMG_PACK . "test.jpg"; |
|
| 121 | - $dest = _DIR_VAR . "test-jpg.jpg"; |
|
| 122 | - $commande = "$jpegtopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 120 | + $vignette = _ROOT_IMG_PACK."test.jpg"; |
|
| 121 | + $dest = _DIR_VAR."test-jpg.jpg"; |
|
| 122 | + $commande = "$jpegtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 123 | 123 | spip_log($commande); |
| 124 | 124 | exec($commande); |
| 125 | 125 | if ($taille = @getimagesize($dest)) { |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | $giftopnm_command = str_replace("pnmscale", "giftopnm", _PNMSCALE_COMMAND); |
| 131 | 131 | $pnmtojpeg_command = str_replace("pnmscale", "pnmtojpeg", _PNMSCALE_COMMAND); |
| 132 | - $vignette = _ROOT_IMG_PACK . "test.gif"; |
|
| 133 | - $dest = _DIR_VAR . "test-gif.jpg"; |
|
| 134 | - $commande = "$giftopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 132 | + $vignette = _ROOT_IMG_PACK."test.gif"; |
|
| 133 | + $dest = _DIR_VAR."test-gif.jpg"; |
|
| 134 | + $commande = "$giftopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 135 | 135 | spip_log($commande); |
| 136 | 136 | exec($commande); |
| 137 | 137 | if ($taille = @getimagesize($dest)) { |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $pngtopnm_command = str_replace("pnmscale", "pngtopnm", _PNMSCALE_COMMAND); |
| 144 | - $vignette = _ROOT_IMG_PACK . "test.png"; |
|
| 145 | - $dest = _DIR_VAR . "test-gif.jpg"; |
|
| 146 | - $commande = "$pngtopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 144 | + $vignette = _ROOT_IMG_PACK."test.png"; |
|
| 145 | + $dest = _DIR_VAR."test-gif.jpg"; |
|
| 146 | + $commande = "$pngtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 147 | 147 | spip_log($commande); |
| 148 | 148 | exec($commande); |
| 149 | 149 | if ($taille = @getimagesize($dest)) { |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | include_spip('inc/filtres'); |
| 168 | 168 | include_spip('inc/filtres_images_mini'); |
| 169 | 169 | $taille_preview = 150; |
| 170 | - $image = _image_valeurs_trans(_DIR_IMG_PACK . 'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg'); |
|
| 170 | + $image = _image_valeurs_trans(_DIR_IMG_PACK.'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg'); |
|
| 171 | 171 | |
| 172 | - $image['fichier_dest'] = _DIR_VAR . "test_$arg"; |
|
| 172 | + $image['fichier_dest'] = _DIR_VAR."test_$arg"; |
|
| 173 | 173 | |
| 174 | 174 | if ($preview = _image_creer_vignette($image, $taille_preview, $taille_preview, $arg, true) |
| 175 | 175 | and ($preview['width'] * $preview['height'] > 0) |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @return string |
| 39 | 39 | **/ |
| 40 | 40 | function base_dump_meta_name($rub) { |
| 41 | - return $meta = "status_dump_{$rub}_" . abs($GLOBALS['visiteur_session']['id_auteur']); |
|
| 41 | + return $meta = "status_dump_{$rub}_".abs($GLOBALS['visiteur_session']['id_auteur']); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $connexion = $GLOBALS['connexions'][$serveur ? $serveur : 0]; |
| 85 | 85 | $prefixe = $connexion['prefixe']; |
| 86 | 86 | |
| 87 | - $p = '/^' . $prefixe . '/'; |
|
| 87 | + $p = '/^'.$prefixe.'/'; |
|
| 88 | 88 | $res = $tables; |
| 89 | 89 | foreach (sql_alltable(null, $serveur) as $t) { |
| 90 | 90 | if (preg_match($p, $t)) { |
@@ -343,8 +343,8 @@ discard block |
||
| 343 | 343 | function base_vider_tables_destination_copie($tables, $exclure_tables = array(), $serveur = '') { |
| 344 | 344 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 345 | 345 | |
| 346 | - spip_log('Vider ' . count($tables) . " tables sur serveur '$serveur' : " . join(', ', $tables), |
|
| 347 | - 'base.' . _LOG_INFO_IMPORTANTE); |
|
| 346 | + spip_log('Vider '.count($tables)." tables sur serveur '$serveur' : ".join(', ', $tables), |
|
| 347 | + 'base.'._LOG_INFO_IMPORTANTE); |
|
| 348 | 348 | foreach ($tables as $table) { |
| 349 | 349 | if (!in_array($table, $exclure_tables)) { |
| 350 | 350 | // sur le serveur principal, il ne faut pas supprimer l'auteur loge ! |
@@ -381,14 +381,14 @@ discard block |
||
| 381 | 381 | function base_conserver_copieur($move = true, $serveur = '') { |
| 382 | 382 | // s'asurer qu'on a pas deja fait la manip ! |
| 383 | 383 | if ($GLOBALS['visiteur_session']['id_auteur'] > 0 and sql_countsel("spip_auteurs", "id_auteur>0")) { |
| 384 | - spip_log('Conserver copieur dans id_auteur=' . $GLOBALS['visiteur_session']['id_auteur'] . " pour le serveur '$serveur'", |
|
| 385 | - 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 384 | + spip_log('Conserver copieur dans id_auteur='.$GLOBALS['visiteur_session']['id_auteur']." pour le serveur '$serveur'", |
|
| 385 | + 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 386 | 386 | sql_delete("spip_auteurs", "id_auteur<0", $serveur); |
| 387 | 387 | if ($move) { |
| 388 | 388 | sql_updateq('spip_auteurs', array('id_auteur' => -$GLOBALS['visiteur_session']['id_auteur']), |
| 389 | - "id_auteur=" . intval($GLOBALS['visiteur_session']['id_auteur']), array(), $serveur); |
|
| 389 | + "id_auteur=".intval($GLOBALS['visiteur_session']['id_auteur']), array(), $serveur); |
|
| 390 | 390 | } else { |
| 391 | - $row = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $GLOBALS['visiteur_session']['id_auteur'], '', '', '', '', |
|
| 391 | + $row = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$GLOBALS['visiteur_session']['id_auteur'], '', '', '', '', |
|
| 392 | 392 | $serveur); |
| 393 | 393 | $row['id_auteur'] = -$GLOBALS['visiteur_session']['id_auteur']; |
| 394 | 394 | sql_insertq('spip_auteurs', $row, array(), $serveur); |
@@ -411,15 +411,15 @@ discard block |
||
| 411 | 411 | // rien a faire si ce n'est pas le serveur principal ! |
| 412 | 412 | if ($serveur == '') { |
| 413 | 413 | if (sql_countsel("spip_auteurs", "id_auteur>0")) { |
| 414 | - spip_log("Detruire copieur id_auteur<0 pour le serveur '$serveur'", 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 414 | + spip_log("Detruire copieur id_auteur<0 pour le serveur '$serveur'", 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 415 | 415 | sql_delete("spip_auteurs", "id_auteur<0", $serveur); |
| 416 | 416 | } else { |
| 417 | 417 | spip_log("Restaurer copieur id_auteur<0 pour le serveur '$serveur' (aucun autre auteur en base)", |
| 418 | - 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 418 | + 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 419 | 419 | sql_update('spip_auteurs', array('id_auteur' => '-id_auteur'), "id_auteur<0"); |
| 420 | 420 | } |
| 421 | 421 | } else { |
| 422 | - spip_log("Pas de destruction copieur sur serveur '$serveur'", 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 422 | + spip_log("Pas de destruction copieur sur serveur '$serveur'", 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | |
@@ -453,19 +453,19 @@ discard block |
||
| 453 | 453 | } |
| 454 | 454 | } else { |
| 455 | 455 | sql_drop_table($table, '', $serveur_dest); |
| 456 | - spip_log("drop table '$table' sur serveur '$serveur_dest'", 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 456 | + spip_log("drop table '$table' sur serveur '$serveur_dest'", 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 457 | 457 | } |
| 458 | 458 | $desc_dest = false; |
| 459 | 459 | } |
| 460 | 460 | // si la table n'existe pas dans la destination, la creer a l'identique ! |
| 461 | 461 | if (!$desc_dest) { |
| 462 | - spip_log("creation '$table' sur serveur '$serveur_dest'", 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 462 | + spip_log("creation '$table' sur serveur '$serveur_dest'", 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 463 | 463 | include_spip('base/create'); |
| 464 | 464 | creer_ou_upgrader_table($table, $desc, 'auto', $upgrade, $serveur_dest); |
| 465 | 465 | $desc_dest = sql_showtable($table, true, $serveur_dest); |
| 466 | 466 | } |
| 467 | 467 | if (!$desc_dest) { |
| 468 | - spip_log("Erreur creation '$table' sur serveur '$serveur_dest'" . var_export($desc, 1), 'dump.' . _LOG_ERREUR); |
|
| 468 | + spip_log("Erreur creation '$table' sur serveur '$serveur_dest'".var_export($desc, 1), 'dump.'._LOG_ERREUR); |
|
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | return $desc_dest; |
@@ -524,16 +524,16 @@ discard block |
||
| 524 | 524 | $racine_fonctions = (isset($options['racine_fonctions_dest']) ? $options['racine_fonctions_dest'] : 'base'); |
| 525 | 525 | $data_pool = (isset($options['data_pool']) ? $options['data_pool'] : 50 * 1024); |
| 526 | 526 | |
| 527 | - spip_log("Copier " . count($tables) . " tables de '$serveur_source' vers '$serveur_dest'", |
|
| 528 | - 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 527 | + spip_log("Copier ".count($tables)." tables de '$serveur_source' vers '$serveur_dest'", |
|
| 528 | + 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 529 | 529 | |
| 530 | 530 | if (!$inserer_copie = charger_fonction($fonction_base_inserer, $racine_fonctions, true)) { |
| 531 | - spip_log("Fonction '{$racine_fonctions}_$fonction_base_inserer' inconnue. Abandon", 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 531 | + spip_log("Fonction '{$racine_fonctions}_$fonction_base_inserer' inconnue. Abandon", 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 532 | 532 | |
| 533 | 533 | return true; // echec mais on a fini, donc true |
| 534 | 534 | } |
| 535 | 535 | if (!$preparer_table_dest = charger_fonction('preparer_table_dest', $racine_fonctions, true)) { |
| 536 | - spip_log("Fonction '{$racine_fonctions}_$preparer_table_dest' inconnue. Abandon", 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 536 | + spip_log("Fonction '{$racine_fonctions}_$preparer_table_dest' inconnue. Abandon", 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 537 | 537 | |
| 538 | 538 | return true; // echec mais on a fini, donc true |
| 539 | 539 | } |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | true) |
| 556 | 556 | ) { |
| 557 | 557 | spip_log("Fonction '{$racine_fonctions}_vider_tables_destination_copie' inconnue. Abandon", |
| 558 | - 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 558 | + 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 559 | 559 | |
| 560 | 560 | return true; // echec mais on a fini, donc true |
| 561 | 561 | } |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | $tables = array_diff($tables, array('spip_meta')); |
| 574 | 574 | $tables[] = 'spip_meta'; |
| 575 | 575 | } |
| 576 | - spip_log("Tables a copier :" . implode(", ", $tables), 'dump.' . _LOG_INFO); |
|
| 576 | + spip_log("Tables a copier :".implode(", ", $tables), 'dump.'._LOG_INFO); |
|
| 577 | 577 | |
| 578 | 578 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 579 | 579 | |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | // mais si ca renvoie false c'est une erreur fatale => abandon |
| 628 | 628 | if ($inserer_copie($table, $rows, $desc_dest, $serveur_dest) === false) { |
| 629 | 629 | // forcer la sortie, charge a l'appelant de gerer l'echec |
| 630 | - spip_log("Erreur fatale dans $inserer_copie table $table", "dump" . _LOG_ERREUR); |
|
| 630 | + spip_log("Erreur fatale dans $inserer_copie table $table", "dump"._LOG_ERREUR); |
|
| 631 | 631 | $status['errors'][] = "Erreur fatale lors de la copie de la table $table"; |
| 632 | 632 | ecrire_fichier($status_file, serialize($status)); |
| 633 | 633 | |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | if ($n == $status['tables_copiees'][$table]) { |
| 643 | 643 | break; |
| 644 | 644 | } |
| 645 | - spip_log("recopie $table " . $status['tables_copiees'][$table], 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 645 | + spip_log("recopie $table ".$status['tables_copiees'][$table], 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 646 | 646 | if ($callback_progression) { |
| 647 | 647 | $callback_progression($status['tables_copiees'][$table], 0, $table); |
| 648 | 648 | } |
@@ -653,43 +653,43 @@ discard block |
||
| 653 | 653 | } |
| 654 | 654 | if ($drop_source) { |
| 655 | 655 | sql_drop_table($table, '', $serveur_source); |
| 656 | - spip_log("drop $table sur serveur source '$serveur_source'", 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 656 | + spip_log("drop $table sur serveur source '$serveur_source'", 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 657 | 657 | } |
| 658 | 658 | $status['tables_copiees'][$table] = ($status['tables_copiees'][$table] ? -$status['tables_copiees'][$table] : "zero"); |
| 659 | 659 | ecrire_fichier($status_file, serialize($status)); |
| 660 | - spip_log("tables_recopiees " . implode(',', array_keys($status['tables_copiees'])), 'dump.' . _LOG_INFO); |
|
| 660 | + spip_log("tables_recopiees ".implode(',', array_keys($status['tables_copiees'])), 'dump.'._LOG_INFO); |
|
| 661 | 661 | if ($callback_progression) { |
| 662 | 662 | $callback_progression($status['tables_copiees'][$table], $status['tables_copiees'][$table], $table); |
| 663 | 663 | } |
| 664 | 664 | } else { |
| 665 | 665 | if ($status['tables_copiees'][$table] < 0) { |
| 666 | - spip_log("Table $table deja copiee : " . $status['tables_copiees'][$table], "dump." . _LOG_INFO); |
|
| 666 | + spip_log("Table $table deja copiee : ".$status['tables_copiees'][$table], "dump."._LOG_INFO); |
|
| 667 | 667 | } |
| 668 | 668 | if ($callback_progression) { |
| 669 | 669 | $callback_progression(0, $status['tables_copiees'][$table], |
| 670 | - "$table" . ((is_numeric($status['tables_copiees'][$table]) and $status['tables_copiees'][$table] >= 0) ? "[Echec]" : "")); |
|
| 670 | + "$table".((is_numeric($status['tables_copiees'][$table]) and $status['tables_copiees'][$table] >= 0) ? "[Echec]" : "")); |
|
| 671 | 671 | } |
| 672 | 672 | } |
| 673 | 673 | } else { |
| 674 | 674 | $status['errors'][] = "Impossible de lire la description de la table $table"; |
| 675 | 675 | ecrire_fichier($status_file, serialize($status)); |
| 676 | - spip_log("Impossible de lire la description de la table $table", "dump." . _LOG_ERREUR); |
|
| 676 | + spip_log("Impossible de lire la description de la table $table", "dump."._LOG_ERREUR); |
|
| 677 | 677 | } |
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | // si le nombre de tables envoyees n'est pas egal au nombre de tables demandees |
| 681 | 681 | // abandonner |
| 682 | 682 | if (count($status['tables_copiees']) < count($tables)) { |
| 683 | - spip_log("Nombre de tables copiees incorrect : " . count($status['tables_copiees']) . "/" . count($tables), |
|
| 684 | - "dump." . _LOG_ERREUR); |
|
| 685 | - $status['errors'][] = "Nombre de tables copiees incorrect : " . count($status['tables_copiees']) . "/" . count($tables); |
|
| 683 | + spip_log("Nombre de tables copiees incorrect : ".count($status['tables_copiees'])."/".count($tables), |
|
| 684 | + "dump."._LOG_ERREUR); |
|
| 685 | + $status['errors'][] = "Nombre de tables copiees incorrect : ".count($status['tables_copiees'])."/".count($tables); |
|
| 686 | 686 | ecrire_fichier($status_file, serialize($status)); |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | if ($detruire_copieur_si_besoin = charger_fonction('detruire_copieur_si_besoin', $racine_fonctions, true)) { |
| 690 | 690 | $detruire_copieur_si_besoin($serveur_dest); |
| 691 | 691 | } else { |
| 692 | - spip_log("Fonction '{$racine_fonctions}_detruire_copieur_si_besoin' inconnue.", 'dump.' . _LOG_INFO_IMPORTANTE); |
|
| 692 | + spip_log("Fonction '{$racine_fonctions}_detruire_copieur_si_besoin' inconnue.", 'dump.'._LOG_INFO_IMPORTANTE); |
|
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | // OK, copie complete |
@@ -713,8 +713,8 @@ discard block |
||
| 713 | 713 | $r = sql_insertq_multi($table, $rows, $desc_dest, $serveur_dest); |
| 714 | 714 | $nb = sql_countsel($table, '', '', '', $serveur_dest); |
| 715 | 715 | if ($nb - $nb1 < count($rows)) { |
| 716 | - spip_log("base_inserer_copie : " . ($nb - $nb1) . " insertions au lieu de " . count($rows) . ". On retente 1 par 1", |
|
| 717 | - "dump" . _LOG_INFO_IMPORTANTE); |
|
| 716 | + spip_log("base_inserer_copie : ".($nb - $nb1)." insertions au lieu de ".count($rows).". On retente 1 par 1", |
|
| 717 | + "dump"._LOG_INFO_IMPORTANTE); |
|
| 718 | 718 | foreach ($rows as $row) { |
| 719 | 719 | // si l'enregistrement est deja en base, ca fera un echec ou un doublon |
| 720 | 720 | $r = sql_insertq($table, $row, $desc_dest, $serveur_dest); |
@@ -723,8 +723,8 @@ discard block |
||
| 723 | 723 | $r = 0; |
| 724 | 724 | $nb = sql_countsel($table, '', '', '', $serveur_dest); |
| 725 | 725 | if ($nb - $nb1 < count($rows)) { |
| 726 | - spip_log("base_inserer_copie : " . ($nb - $nb1) . " insertions au lieu de " . count($rows) . " apres insertion 1 par 1", |
|
| 727 | - "dump" . _LOG_ERREUR); |
|
| 726 | + spip_log("base_inserer_copie : ".($nb - $nb1)." insertions au lieu de ".count($rows)." apres insertion 1 par 1", |
|
| 727 | + "dump"._LOG_ERREUR); |
|
| 728 | 728 | $r = false; |
| 729 | 729 | } |
| 730 | 730 | } |
@@ -416,7 +416,7 @@ |
||
| 416 | 416 | $h = generer_action_auteur("instituer_objet", "$type-$id-$statut"); |
| 417 | 417 | $t = supprimer_tags($titre); |
| 418 | 418 | |
| 419 | - return "<a href=\"#\" data-puce-id=\"$id\" data-puce-type=\"$type\" data-puce-decal=\"$n\" data-puce-action=\"$h\" title=\"$t\"$act>" . http_img_pack($img, $t) . "</a>"; |
|
| 419 | + return "<a href=\"#\" data-puce-id=\"$id\" data-puce-type=\"$type\" data-puce-decal=\"$n\" data-puce-action=\"$h\" title=\"$t\"$act>".http_img_pack($img, $t)."</a>"; |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | // compat |
@@ -147,7 +147,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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'])) { |
@@ -217,25 +217,25 @@ discard block |
||
| 217 | 217 | $valeur_simple = array(); |
| 218 | 218 | foreach ($valeur as $v) { |
| 219 | 219 | if (is_array($v)) { |
| 220 | - $valeur_simple[] = 'array:' . count($v); |
|
| 220 | + $valeur_simple[] = 'array:'.count($v); |
|
| 221 | 221 | } elseif (is_object($v)) { |
| 222 | 222 | $valeur_simple[] = get_class($v); |
| 223 | 223 | } elseif (is_string($v)) { |
| 224 | - $valeur_simple[] = "'" . $v . "'"; |
|
| 224 | + $valeur_simple[] = "'".$v."'"; |
|
| 225 | 225 | } else { |
| 226 | 226 | $valeur_simple[] = $v; |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | $n = count($valeur); |
| 230 | - $valeur = (($n > 3) ? 'array:' . $n . ' ' : ''); |
|
| 231 | - $valeur .= '[' . join(', ', $valeur_simple) . ']'; |
|
| 230 | + $valeur = (($n > 3) ? 'array:'.$n.' ' : ''); |
|
| 231 | + $valeur .= '['.join(', ', $valeur_simple).']'; |
|
| 232 | 232 | } elseif (is_object($valeur)) { |
| 233 | 233 | $valeur = get_class($valeur); |
| 234 | 234 | } elseif (is_string($valeur)) { |
| 235 | - $valeur = "'" . $valeur . "'"; |
|
| 235 | + $valeur = "'".$valeur."'"; |
|
| 236 | 236 | } |
| 237 | - $res .= "\n<tr><td><strong>" . nl2br(entites_html($nom)) |
|
| 238 | - . "</strong></td><td>: " . nl2br(entites_html($valeur)) |
|
| 237 | + $res .= "\n<tr><td><strong>".nl2br(entites_html($nom)) |
|
| 238 | + . "</strong></td><td>: ".nl2br(entites_html($valeur)) |
|
| 239 | 239 | . "</td></tr>\n"; |
| 240 | 240 | } |
| 241 | 241 | |
@@ -263,10 +263,10 @@ discard block |
||
| 263 | 263 | $nom_code = $lieu->descr['nom']; |
| 264 | 264 | $skel = $lieu->descr['sourcefile']; |
| 265 | 265 | $h2 = parametre_url($href, 'var_mode_objet', $nom_code); |
| 266 | - $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne; |
|
| 266 | + $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne; |
|
| 267 | 267 | $skel = "<a href='$h3'><b>$skel</b></a>"; |
| 268 | 268 | if ($boucle) { |
| 269 | - $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle'); |
|
| 269 | + $h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle'); |
|
| 270 | 270 | $boucle = "<a href='$h3'><b>$boucle</b></a>"; |
| 271 | 271 | } |
| 272 | 272 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | // Requete erronee |
| 356 | - $err = "<b>" . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n" |
|
| 356 | + $err = "<b>"._T('avis_erreur_mysql')." $errno</b><br /><tt>\n" |
|
| 357 | 357 | . spip_htmlspecialchars($msg) |
| 358 | 358 | . "\n<br /><span style='color: red'><b>" |
| 359 | 359 | . spip_htmlspecialchars($query) |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | // https://code.spip.net/@trouve_boucle_debug |
| 369 | 369 | function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = "") { |
| 370 | 370 | |
| 371 | - $id = $nom . $boucle; |
|
| 371 | + $id = $nom.$boucle; |
|
| 372 | 372 | if (is_array($GLOBALS['debug_objets']['sequence'][$id])) { |
| 373 | 373 | foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) { |
| 374 | 374 | |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | - $incl = ',' . $reg[1] . '[.]\w$,'; |
|
| 422 | + $incl = ','.$reg[1].'[.]\w$,'; |
|
| 423 | 423 | |
| 424 | 424 | foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) { |
| 425 | 425 | if (preg_match($incl, $v)) { |
@@ -435,16 +435,13 @@ discard block |
||
| 435 | 435 | list($skel, $boucle, $ligne) = trouve_boucle_debug($n, $nom); |
| 436 | 436 | |
| 437 | 437 | if (!$boucle) { |
| 438 | - return !$ligne ? "" : |
|
| 439 | - (" (" . |
|
| 440 | - (($nom != $skel) ? _T('squelette_inclus_ligne') : |
|
| 441 | - _T('squelette_ligne')) . |
|
| 438 | + return !$ligne ? "" : (" (". |
|
| 439 | + (($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')). |
|
| 442 | 440 | " <a href='$self&var_mode_objet=$skel&var_mode_affiche=squelette&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"); |
| 443 | 441 | } else { |
| 444 | 442 | $self .= "&var_mode_objet=$skel$boucle&var_mode_affiche=boucle"; |
| 445 | 443 | |
| 446 | - return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : |
|
| 447 | - " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 444 | + 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>)"; |
|
| 448 | 445 | } |
| 449 | 446 | } |
| 450 | 447 | |
@@ -466,13 +463,13 @@ discard block |
||
| 466 | 463 | } |
| 467 | 464 | |
| 468 | 465 | $s = preg_replace(',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,', |
| 469 | - '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>', |
|
| 466 | + '<\1>\2</\1><br />'."\n".'<\1>\3</\1>', |
|
| 470 | 467 | $s); |
| 471 | 468 | |
| 472 | 469 | |
| 473 | 470 | $tableau = explode("<br />", $s); |
| 474 | 471 | |
| 475 | - $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"; |
|
| 472 | + $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"; |
|
| 476 | 473 | |
| 477 | 474 | $format10 = str_replace('white', 'lightgrey', $format); |
| 478 | 475 | $formaterr = "color: red;"; |
@@ -516,7 +513,7 @@ discard block |
||
| 516 | 513 | . '" style="cursor: pointer;">' |
| 517 | 514 | . ($nocpt ? '' : _T('info_numero_abbreviation')) |
| 518 | 515 | . "</div> |
| 519 | - " . $res . "</div>\n"; |
|
| 516 | + " . $res."</div>\n"; |
|
| 520 | 517 | } |
| 521 | 518 | |
| 522 | 519 | // l'environnement graphique du debuggueur |
@@ -537,14 +534,14 @@ discard block |
||
| 537 | 534 | if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) { |
| 538 | 535 | list($legend, $texte, $res2) = debusquer_source($fonc, $mode); |
| 539 | 536 | $texte .= $res2; |
| 540 | - } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) { |
|
| 541 | - $legend = _T('zbug_' . $mode); |
|
| 542 | - $texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout']; |
|
| 537 | + } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) { |
|
| 538 | + $legend = _T('zbug_'.$mode); |
|
| 539 | + $texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout']; |
|
| 543 | 540 | $texte = ancre_texte($texte, array('', '')); |
| 544 | 541 | } |
| 545 | 542 | } else { |
| 546 | 543 | if (strlen(trim($res))) { |
| 547 | - 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>"; |
|
| 544 | + 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>"; |
|
| 548 | 545 | } else { |
| 549 | 546 | // cas de l'appel sur erreur: montre la page |
| 550 | 547 | return isset($GLOBALS['debug_objets']['resultat']['tout']) |
@@ -554,7 +551,7 @@ discard block |
||
| 554 | 551 | } |
| 555 | 552 | } else { |
| 556 | 553 | $valider = charger_fonction('valider', 'xml'); |
| 557 | - $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']); |
|
| 554 | + $val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']); |
|
| 558 | 555 | // Si erreur, signaler leur nombre dans le formulaire admin |
| 559 | 556 | $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : ''; |
| 560 | 557 | list($texte, $err) = emboite_texte($val, $fonc, $self); |
@@ -565,14 +562,14 @@ discard block |
||
| 565 | 562 | } else { |
| 566 | 563 | $err = ": $err"; |
| 567 | 564 | } |
| 568 | - $legend = _T('validation') . ' ' . $err; |
|
| 565 | + $legend = _T('validation').' '.$err; |
|
| 569 | 566 | $res = $id = ''; |
| 570 | 567 | } |
| 571 | 568 | |
| 572 | 569 | return !trim($texte) ? '' : ( |
| 573 | - "<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" |
|
| 570 | + "<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" |
|
| 574 | 571 | . "<div id='debug_boucle'><fieldset$id><legend>" |
| 575 | - . "<a href='" . $self . "#f_" . substr($fonc, 0, 37) . "'> ↑ " |
|
| 572 | + . "<a href='".$self."#f_".substr($fonc, 0, 37)."'> ↑ " |
|
| 576 | 573 | . ($legend ? $legend : $mode) |
| 577 | 574 | . "</a></legend>" |
| 578 | 575 | . $texte |
@@ -584,7 +581,7 @@ discard block |
||
| 584 | 581 | // https://code.spip.net/@emboite_texte |
| 585 | 582 | function emboite_texte($res, $fonc = '', $self = '') { |
| 586 | 583 | $errs = $res->err; |
| 587 | - $texte = $res->entete . ($errs ? '' : $res->page); |
|
| 584 | + $texte = $res->entete.($errs ? '' : $res->page); |
|
| 588 | 585 | |
| 589 | 586 | if (!$texte and !$errs) { |
| 590 | 587 | return array(ancre_texte('', array('', '')), false); |
@@ -641,7 +638,7 @@ discard block |
||
| 641 | 638 | $err = "<h2 style='text-align: center'>" |
| 642 | 639 | . $i |
| 643 | 640 | . "<a href='#fin_err'>" |
| 644 | - . " " . _T('erreur_texte') |
|
| 641 | + . " "._T('erreur_texte') |
|
| 645 | 642 | . "</a></h2><table id='debut_err' style='width: 100%'>" |
| 646 | 643 | . $err |
| 647 | 644 | . " </table><a id='fin_err'></a>"; |
@@ -651,9 +648,9 @@ discard block |
||
| 651 | 648 | list($msg, $fermant, $ouvrant) = $errs[0]; |
| 652 | 649 | $rf = reference_boucle_debug($fermant, $fonc, $self); |
| 653 | 650 | $ro = reference_boucle_debug($ouvrant, $fonc, $self); |
| 654 | - $err = $msg . |
|
| 655 | - "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" . |
|
| 656 | - "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro"; |
|
| 651 | + $err = $msg. |
|
| 652 | + "<a href='#L".$fermant."'>$fermant</a>$rf<br />". |
|
| 653 | + "<a href='#L".$ouvrant."'>$ouvrant</a>$ro"; |
|
| 657 | 654 | |
| 658 | 655 | return array(ancre_texte($texte, array(array($ouvrant), array($fermant))), $err); |
| 659 | 656 | } |
@@ -685,7 +682,7 @@ discard block |
||
| 685 | 682 | $temps = !isset($GLOBALS['debug_objets']['profile'][$sourcefile]) ? '' : _T('zbug_profile', |
| 686 | 683 | array('time' => $GLOBALS['debug_objets']['profile'][$sourcefile])); |
| 687 | 684 | |
| 688 | - $res .= "<fieldset id='f_" . $nom . "'><legend>" |
|
| 685 | + $res .= "<fieldset id='f_".$nom."'><legend>" |
|
| 689 | 686 | . $t_skel |
| 690 | 687 | . ' ' |
| 691 | 688 | . $sourcefile |
@@ -700,7 +697,7 @@ discard block |
||
| 700 | 697 | . "'>" |
| 701 | 698 | . _T('zbug_calcul') |
| 702 | 699 | . "</a></legend>" |
| 703 | - . (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />")) |
|
| 700 | + . (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />")) |
|
| 704 | 701 | . debusquer_contexte($contexte[$sourcefile]) |
| 705 | 702 | . (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n")) |
| 706 | 703 | . "</fieldset>\n"; |
@@ -721,33 +718,33 @@ discard block |
||
| 721 | 718 | $nom = $boucle->id_boucle; |
| 722 | 719 | $req = $boucle->type_requete; |
| 723 | 720 | $crit = public_decompiler($boucle, $gram, 0, 'criteres'); |
| 724 | - $self2 = $self . "&var_mode_objet=" . $objet; |
|
| 725 | - |
|
| 726 | - $res .= "\n<tr style='background-color: " . |
|
| 727 | - ($i % 2 ? '#e0e0f0' : '#f8f8ff') . |
|
| 728 | - "'><td align='right'>$i</td><td>\n" . |
|
| 729 | - "<a class='debug_link_boucle' href='" . |
|
| 730 | - $self2 . |
|
| 731 | - "&var_mode_affiche=boucle#f_$nom_skel'>" . |
|
| 732 | - _T('zbug_boucle') . |
|
| 733 | - "</a></td><td>\n<a class='debug_link_boucle' href='" . |
|
| 734 | - $self2 . |
|
| 735 | - "&var_mode_affiche=resultat#f_$nom_skel'>" . |
|
| 736 | - _T('zbug_resultat') . |
|
| 737 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 738 | - $self2 . |
|
| 739 | - "&var_mode_affiche=code#f_$nom_skel'>" . |
|
| 740 | - _T('zbug_code') . |
|
| 741 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 742 | - str_replace('var_mode=', 'var_profile=', $self2) . |
|
| 743 | - "'>" . |
|
| 744 | - _T('zbug_calcul') . |
|
| 745 | - "</a></td><td>\n" . |
|
| 746 | - (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) . |
|
| 747 | - "</td><td>\n" . |
|
| 748 | - $req . |
|
| 749 | - "</td><td>\n" . |
|
| 750 | - spip_htmlspecialchars($crit) . |
|
| 721 | + $self2 = $self."&var_mode_objet=".$objet; |
|
| 722 | + |
|
| 723 | + $res .= "\n<tr style='background-color: ". |
|
| 724 | + ($i % 2 ? '#e0e0f0' : '#f8f8ff'). |
|
| 725 | + "'><td align='right'>$i</td><td>\n". |
|
| 726 | + "<a class='debug_link_boucle' href='". |
|
| 727 | + $self2. |
|
| 728 | + "&var_mode_affiche=boucle#f_$nom_skel'>". |
|
| 729 | + _T('zbug_boucle'). |
|
| 730 | + "</a></td><td>\n<a class='debug_link_boucle' href='". |
|
| 731 | + $self2. |
|
| 732 | + "&var_mode_affiche=resultat#f_$nom_skel'>". |
|
| 733 | + _T('zbug_resultat'). |
|
| 734 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 735 | + $self2. |
|
| 736 | + "&var_mode_affiche=code#f_$nom_skel'>". |
|
| 737 | + _T('zbug_code'). |
|
| 738 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 739 | + str_replace('var_mode=', 'var_profile=', $self2). |
|
| 740 | + "'>". |
|
| 741 | + _T('zbug_calcul'). |
|
| 742 | + "</a></td><td>\n". |
|
| 743 | + (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom). |
|
| 744 | + "</td><td>\n". |
|
| 745 | + $req. |
|
| 746 | + "</td><td>\n". |
|
| 747 | + spip_htmlspecialchars($crit). |
|
| 751 | 748 | "</td></tr>"; |
| 752 | 749 | } |
| 753 | 750 | } |
@@ -774,7 +771,7 @@ discard block |
||
| 774 | 771 | } |
| 775 | 772 | // permettre le copier/coller facile |
| 776 | 773 | // $res = ancre_texte($req, array(), true); |
| 777 | - $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; |
|
| 774 | + $res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n"; |
|
| 778 | 775 | // formatage et affichage des resultats bruts de la requete |
| 779 | 776 | $ress_req = spip_query($req); |
| 780 | 777 | $brut_sql = ''; |
@@ -784,10 +781,10 @@ discard block |
||
| 784 | 781 | $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; |
| 785 | 782 | while ($retours_sql = sql_fetch($ress_req)) { |
| 786 | 783 | if ($num <= $max_aff) { |
| 787 | - $brut_sql .= "<h3>" . ($num == 1 ? $num . " sur " . sql_count($ress_req) : $num) . "</h3>"; |
|
| 784 | + $brut_sql .= "<h3>".($num == 1 ? $num." sur ".sql_count($ress_req) : $num)."</h3>"; |
|
| 788 | 785 | $brut_sql .= "<p>"; |
| 789 | 786 | foreach ($retours_sql as $key => $val) { |
| 790 | - $brut_sql .= "<strong>" . $key . "</strong> => " . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; |
|
| 787 | + $brut_sql .= "<strong>".$key."</strong> => ".spip_htmlspecialchars(couper($val, 150))."<br />\n"; |
|
| 791 | 788 | } |
| 792 | 789 | $brut_sql .= "</p>"; |
| 793 | 790 | } |
@@ -798,15 +795,15 @@ discard block |
||
| 798 | 795 | // ne pas afficher les $contexte_inclus |
| 799 | 796 | $view = preg_replace(",<\?php.+\?[>],Uims", "", $view); |
| 800 | 797 | if ($view) { |
| 801 | - $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . "</fieldset>"; |
|
| 798 | + $res2 .= "\n<br /><fieldset>".interdire_scripts($view)."</fieldset>"; |
|
| 802 | 799 | } |
| 803 | 800 | } |
| 804 | 801 | |
| 805 | 802 | } elseif ($affiche == 'code') { |
| 806 | 803 | $legend = $nom; |
| 807 | - $res = ancre_texte("<" . "?php\n" . $quoi . "\n?" . ">"); |
|
| 804 | + $res = ancre_texte("<"."?php\n".$quoi."\n?".">"); |
|
| 808 | 805 | } elseif ($affiche == 'boucle') { |
| 809 | - $legend = _T('zbug_boucle') . ' ' . $nom; |
|
| 806 | + $legend = _T('zbug_boucle').' '.$nom; |
|
| 810 | 807 | // Le compilateur prefixe le nom des boucles par l'extension du fichier source. |
| 811 | 808 | $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : ''; |
| 812 | 809 | $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); |
@@ -825,23 +822,23 @@ discard block |
||
| 825 | 822 | include_spip('public/assembler'); // pour inclure_balise_dynamique |
| 826 | 823 | include_spip('inc/texte'); // pour corriger_typo |
| 827 | 824 | |
| 828 | - return _DOCTYPE_ECRIRE . |
|
| 829 | - html_lang_attributes() . |
|
| 830 | - "<head>\n<title>" . |
|
| 831 | - ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' . |
|
| 832 | - _T('admin_debug') . ' ' . $titre . ' (' . |
|
| 833 | - supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) . |
|
| 834 | - ")</title>\n" . |
|
| 835 | - "<meta http-equiv='Content-Type' content='text/html" . |
|
| 836 | - (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') . |
|
| 837 | - "' />\n" . |
|
| 825 | + return _DOCTYPE_ECRIRE. |
|
| 826 | + html_lang_attributes(). |
|
| 827 | + "<head>\n<title>". |
|
| 828 | + ('SPIP '.$GLOBALS['spip_version_affichee'].' '. |
|
| 829 | + _T('admin_debug').' '.$titre.' ('. |
|
| 830 | + supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))). |
|
| 831 | + ")</title>\n". |
|
| 832 | + "<meta http-equiv='Content-Type' content='text/html". |
|
| 833 | + (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''). |
|
| 834 | + "' />\n". |
|
| 838 | 835 | http_script('', 'jquery.js') |
| 839 | - . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css')) |
|
| 840 | - . "' type='text/css' />" . |
|
| 841 | - "</head>\n" . |
|
| 842 | - "<body style='margin:0 10px;'>\n" . |
|
| 843 | - "<div id='spip-debug-header'>" . |
|
| 844 | - $corps . |
|
| 845 | - inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) . |
|
| 836 | + . "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) |
|
| 837 | + . "' type='text/css' />". |
|
| 838 | + "</head>\n". |
|
| 839 | + "<body style='margin:0 10px;'>\n". |
|
| 840 | + "<div id='spip-debug-header'>". |
|
| 841 | + $corps. |
|
| 842 | + inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false). |
|
| 846 | 843 | '</div></body></html>'; |
| 847 | 844 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $texte = $x . $texte; |
|
| 67 | + $texte = $x.$texte; |
|
| 68 | 68 | |
| 69 | 69 | return $texte; |
| 70 | 70 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | if (isset($_SERVER['HTTP_REFERER'])) { |
| 102 | 102 | $_SERVER['HTTP_REFERER'] = preg_replace(',[^\w\,/#&;:-]+,', ' ', $_SERVER['HTTP_REFERER']); |
| 103 | 103 | } |
| 104 | - if ($rech){ |
|
| 104 | + if ($rech) { |
|
| 105 | 105 | $rech = preg_replace(',[^\w\,/#&;:-]+,', ' ', $rech); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | || ($pos = 0); |
| 177 | 177 | |
| 178 | 178 | if (false === strpos(substr($texte, 0, $pos), '<!-- insert_head -->')) { |
| 179 | - $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n"; |
|
| 179 | + $insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n"; |
|
| 180 | 180 | $texte = substr_replace($texte, $insert, $pos, 0); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | if (!$pos = stripos($texte, '<head') or !$pos = strpos($texte, '>', $pos)) { |
| 213 | 213 | $pos = -1; |
| 214 | 214 | } |
| 215 | - $texte = substr_replace($texte, $x, $pos+1, 0); |
|
| 215 | + $texte = substr_replace($texte, $x, $pos + 1, 0); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | if (isset($GLOBALS['affiche_boutons_admin']) and $GLOBALS['affiche_boutons_admin']) { |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | // inserer avant le </body> fermant si on peut, a la fin de la page sinon |
| 280 | 280 | if (($p = strpos($texte, '</body>')) !== false) { |
| 281 | - $texte = substr($texte, 0, $p) . $code . substr($texte, $p); |
|
| 281 | + $texte = substr($texte, 0, $p).$code.substr($texte, $p); |
|
| 282 | 282 | } else { |
| 283 | 283 | $texte .= $code; |
| 284 | 284 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | // si id numerique et un seul objet possible, pas d'ambiguite |
| 160 | 160 | if (is_numeric($ref) and count($objets) === 1) { |
| 161 | - $ref = reset($objets) . $ref; |
|
| 161 | + $ref = reset($objets).$ref; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // Si la référence ne correspond à rien, c'est fini |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | return json_export(false); |
| 167 | 167 | } |
| 168 | 168 | // Sinon on récupère les infos utiles |
| 169 | - @list($type, , $id, , , , ) = $match; |
|
| 169 | + @list($type,, $id,,,,) = $match; |
|
| 170 | 170 | |
| 171 | 171 | // On regarde si le type trouvé fait partie des objets sélectionnables |
| 172 | 172 | if (!in_array(table_objet($type), $objets)) { |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | $types = (is_array($types) ? array_filter($types) : array()); |
| 212 | 212 | |
| 213 | 213 | // recuperer tous les freres et soeurs de la rubrique visee |
| 214 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 215 | - $fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent=' . intval($id_parent)); |
|
| 214 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 215 | + $fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent='.intval($id_parent)); |
|
| 216 | 216 | $fratrie = array_column($fratrie, 'id_rubrique'); |
| 217 | 217 | $has = sql_allfetsel('DISTINCT id_parent', 'spip_rubriques', sql_in('id_parent', $fratrie)); |
| 218 | 218 | $has = array_column($has, 'id_parent'); |
@@ -37,17 +37,17 @@ discard block |
||
| 37 | 37 | * string : La langue qui a été utilisée si trouvée |
| 38 | 38 | * false : aucune langue ne correspondait à la demande |
| 39 | 39 | **/ |
| 40 | -function changer_langue($lang, $liste_langues=null) { |
|
| 40 | +function changer_langue($lang, $liste_langues = null) { |
|
| 41 | 41 | |
| 42 | 42 | if (is_null($liste_langues)) { |
| 43 | - $liste_langues = @$GLOBALS['meta']['langues_proposees'] . ',' . @$GLOBALS['meta']['langues_multilingue']; |
|
| 43 | + $liste_langues = @$GLOBALS['meta']['langues_proposees'].','.@$GLOBALS['meta']['langues_multilingue']; |
|
| 44 | 44 | } |
| 45 | 45 | else { |
| 46 | 46 | if (is_array($liste_langues)) { |
| 47 | 47 | $liste_langues = implode(',', $liste_langues); |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | - $liste_langues = ',' . $liste_langues . ','; |
|
| 50 | + $liste_langues = ','.$liste_langues.','; |
|
| 51 | 51 | |
| 52 | 52 | // Si la langue demandee n'existe pas, on essaie d'autres variantes |
| 53 | 53 | // Exemple : 'pt-br' => 'pt_br' => 'pt' |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | foreach ($langues as $l) { |
| 200 | 200 | $selected = ($l == $default) ? ' selected=\'selected\'' : ''; |
| 201 | - $ret .= "<option value='$l'$selected>[" . $l . "] " . traduire_nom_langue($l) . "</option>\n"; |
|
| 201 | + $ret .= "<option value='$l'$selected>[".$l."] ".traduire_nom_langue($l)."</option>\n"; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | if (!test_espace_prive()) { |
@@ -213,23 +213,21 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | return generer_action_auteur('converser', $base, $cible, |
| 215 | 215 | (select_langues($nom_select, $change, $ret) |
| 216 | - . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"), |
|
| 216 | + . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"), |
|
| 217 | 217 | " method='post'"); |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // https://code.spip.net/@select_langues |
| 221 | 221 | function select_langues($nom_select, $change, $options, $label = "") { |
| 222 | 222 | static $cpt = 0; |
| 223 | - $id = "menu_langues" . $cpt++; |
|
| 223 | + $id = "menu_langues".$cpt++; |
|
| 224 | 224 | |
| 225 | 225 | return |
| 226 | - "<label for='$id'>" . ($label ? $label : _T('info_langues')) . "</label> " . |
|
| 226 | + "<label for='$id'>".($label ? $label : _T('info_langues'))."</label> ". |
|
| 227 | 227 | "<select name='$nom_select' id='$id' " |
| 228 | 228 | . ((!test_espace_prive()) ? |
| 229 | - ("class='forml menu_langues'") : |
|
| 230 | - (($nom_select == 'var_lang_ecrire') ? |
|
| 231 | - ("class='lang_ecrire'") : |
|
| 232 | - "class='fondl'")) |
|
| 229 | + ("class='forml menu_langues'") : (($nom_select == 'var_lang_ecrire') ? |
|
| 230 | + ("class='lang_ecrire'") : "class='fondl'")) |
|
| 233 | 231 | . $change |
| 234 | 232 | . ">\n" |
| 235 | 233 | . $options |
@@ -353,7 +351,7 @@ discard block |
||
| 353 | 351 | and (!isset($GLOBALS['spip_lang']) |
| 354 | 352 | or $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) |
| 355 | 353 | ) { |
| 356 | - return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install |
|
| 354 | + return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install |
|
| 357 | 355 | } |
| 358 | 356 | // en theorie là, la globale est définie, sinon c'est un problème. |
| 359 | 357 | if (!isset($GLOBALS['spip_lang'])) { |
@@ -456,7 +454,7 @@ discard block |
||
| 456 | 454 | if (!isset($GLOBALS['meta']['langue_site'])) { |
| 457 | 455 | // Initialisation : le francais si dispo, sinon la premiere langue trouvee |
| 458 | 456 | $GLOBALS['meta']['langue_site'] = $tout = |
| 459 | - (!$all_langs or (strpos(',' . _LANGUE_PAR_DEFAUT . ',', ",$all_langs,") !== false)) |
|
| 457 | + (!$all_langs or (strpos(','._LANGUE_PAR_DEFAUT.',', ",$all_langs,") !== false)) |
|
| 460 | 458 | ? _LANGUE_PAR_DEFAUT : substr($all_langs, 0, strpos($all_langs, ',')); |
| 461 | 459 | ecrire_meta('langue_site', $tout); |
| 462 | 460 | } |