@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | if (in_array('eval', $trace_fonctions) and in_array('inclure_modele', $trace_fonctions)) { |
| 105 | 105 | $k = array_search('inclure_modele', $trace_fonctions); |
| 106 | 106 | // les arguments de recuperer_fond() passes par inclure_modele() |
| 107 | - return $trace[$k-1]['args'][1]['args']; |
|
| 107 | + return $trace[$k - 1]['args'][1]['args']; |
|
| 108 | 108 | } |
| 109 | 109 | return false; |
| 110 | 110 | } |
@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | if (isset($valeurs['_action'])) { |
| 251 | 251 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
| 252 | 252 | $secu = $securiser_action(reset($valeurs['_action']), end($valeurs['_action']), '', -1); |
| 253 | - $valeurs['_hidden'] = (isset($valeurs['_hidden']) ? $valeurs['_hidden'] : '') . |
|
| 254 | - "<input type='hidden' name='arg' value='" . $secu['arg'] . "' />" |
|
| 255 | - . "<input type='hidden' name='hash' value='" . $secu['hash'] . "' />"; |
|
| 253 | + $valeurs['_hidden'] = (isset($valeurs['_hidden']) ? $valeurs['_hidden'] : ''). |
|
| 254 | + "<input type='hidden' name='arg' value='".$secu['arg']."' />" |
|
| 255 | + . "<input type='hidden' name='hash' value='".$secu['hash']."' />"; |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | // empiler la lang en tant que premier argument implicite du CVT |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | // et si $k ne commence pas par un _ (c'est bien une vrai erreur sur un vrai champ) |
| 293 | 293 | if (html5_permis()) { |
| 294 | 294 | foreach ($erreurs as $k => $v) { |
| 295 | - if (is_string($v) and strlen(trim($v)) and strpos($k,'_') !== 0) { |
|
| 295 | + if (is_string($v) and strlen(trim($v)) and strpos($k, '_') !== 0) { |
|
| 296 | 296 | // on encapsule dans un span car ces messages sont en general simple, juste du texte, et deja dans un span dans le form |
| 297 | 297 | $valeurs['erreurs'][$k] = "<span role='alert'>".$erreurs[$k]."</span>"; |
| 298 | 298 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | return; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | -include_spip('inc/charsets'); # pour le nom de fichier |
|
| 23 | +include_spip('inc/charsets'); # pour le nom de fichier |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Effacer une rubrique |
@@ -37,24 +37,24 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | if (intval($id_rubrique)) { |
| 39 | 39 | |
| 40 | - sql_delete("spip_rubriques", "id_rubrique=" . intval($id_rubrique)); |
|
| 40 | + sql_delete("spip_rubriques", "id_rubrique=".intval($id_rubrique)); |
|
| 41 | 41 | // Les admin restreints qui n'administraient que cette rubrique |
| 42 | 42 | // deviennent redacteurs |
| 43 | 43 | // (il y a sans doute moyen de faire ca avec un having) |
| 44 | 44 | |
| 45 | - $q = sql_select("id_auteur", "spip_auteurs_liens", "objet='rubrique' AND id_objet=" . intval($id_rubrique)); |
|
| 45 | + $q = sql_select("id_auteur", "spip_auteurs_liens", "objet='rubrique' AND id_objet=".intval($id_rubrique)); |
|
| 46 | 46 | while ($r = sql_fetch($q)) { |
| 47 | 47 | $id_auteur = $r['id_auteur']; |
| 48 | 48 | // degrader avant de supprimer la restriction d'admin |
| 49 | 49 | // section critique sur les droits |
| 50 | 50 | $n = sql_countsel("spip_auteurs_liens", |
| 51 | - "objet='rubrique' AND id_objet!=" . intval($id_rubrique) . " AND id_auteur=" . intval($id_auteur)); |
|
| 51 | + "objet='rubrique' AND id_objet!=".intval($id_rubrique)." AND id_auteur=".intval($id_auteur)); |
|
| 52 | 52 | if (!$n) { |
| 53 | 53 | include_spip('action/editer_auteur'); |
| 54 | 54 | auteur_modifier($id_auteur, array("statut" => '1comite')); |
| 55 | 55 | } |
| 56 | 56 | sql_delete("spip_auteurs_liens", |
| 57 | - "objet='rubrique' AND id_objet=" . intval($id_rubrique) . " AND id_auteur=" . intval($id_auteur)); |
|
| 57 | + "objet='rubrique' AND id_objet=".intval($id_rubrique)." AND id_auteur=".intval($id_auteur)); |
|
| 58 | 58 | } |
| 59 | 59 | // menu_rubriques devra recalculer |
| 60 | 60 | effacer_meta("date_calcul_rubriques"); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $res = admin_repair_tables(); |
| 40 | 40 | if (!$res) { |
| 41 | - $res = "<div class='error'>" . _T('avis_erreur_mysql') . ' ' . sql_errno() . ': ' . sql_error() . "</div>\n"; |
|
| 41 | + $res = "<div class='error'>"._T('avis_erreur_mysql').' '.sql_errno().': '.sql_error()."</div>\n"; |
|
| 42 | 42 | } else { |
| 43 | 43 | include_spip('inc/rubriques'); |
| 44 | 44 | calculer_rubriques(); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | include_spip('inc/minipres'); |
| 48 | 48 | $res .= pipeline('base_admin_repair', $res); |
| 49 | 49 | echo minipres(_T('texte_tentative_recuperation'), |
| 50 | - $res . generer_form_ecrire('accueil', '', '', _T('public:accueil_site'))); |
|
| 50 | + $res.generer_form_ecrire('accueil', '', '', _T('public:accueil_site'))); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -90,24 +90,24 @@ discard block |
||
| 90 | 90 | $count = sql_countsel($tab); |
| 91 | 91 | |
| 92 | 92 | if ($count > 1) { |
| 93 | - $m .= "(" . _T('texte_compte_elements', array('count' => $count)) . ")\n"; |
|
| 93 | + $m .= "("._T('texte_compte_elements', array('count' => $count)).")\n"; |
|
| 94 | 94 | } else { |
| 95 | 95 | if ($count == 1) { |
| 96 | - $m .= "(" . _T('texte_compte_element', array('count' => $count)) . ")\n"; |
|
| 96 | + $m .= "("._T('texte_compte_element', array('count' => $count)).")\n"; |
|
| 97 | 97 | } else { |
| 98 | - $m .= "(" . _T('texte_vide') . ")\n"; |
|
| 98 | + $m .= "("._T('texte_vide').")\n"; |
|
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | if ($result_repair |
| 103 | 103 | and $msg = join(" ", |
| 104 | - (is_resource($result_repair) or is_object($result_repair)) ? sql_fetch($result_repair) : $result_repair) . ' ' |
|
| 104 | + (is_resource($result_repair) or is_object($result_repair)) ? sql_fetch($result_repair) : $result_repair).' ' |
|
| 105 | 105 | and strpos($msg, ' OK ') === false |
| 106 | 106 | ) { |
| 107 | 107 | $class = " class='notice'"; |
| 108 | - $m .= "<br /><tt>" . spip_htmlentities($msg) . "</tt>\n"; |
|
| 108 | + $m .= "<br /><tt>".spip_htmlentities($msg)."</tt>\n"; |
|
| 109 | 109 | } else { |
| 110 | - $m .= " " . _T('texte_table_ok'); |
|
| 110 | + $m .= " "._T('texte_table_ok'); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | $res .= "<div$class>$m</div>"; |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | $hsl = _couleur_hex_to_hsl($couleur); |
| 205 | 205 | $hsl = [ |
| 206 | 206 | 'h' => round($hsl['h'] * 360), |
| 207 | - 's' => round($hsl['s'] * 100) . '%', |
|
| 208 | - 'l' => round($hsl['l'] * 100) . '%' |
|
| 207 | + 's' => round($hsl['s'] * 100).'%', |
|
| 208 | + 'l' => round($hsl['l'] * 100).'%' |
|
| 209 | 209 | ]; |
| 210 | 210 | if ($format === null) { |
| 211 | 211 | return "hsl({$hsl['h']}, {$hsl['s']}, {$hsl['l']})"; |
@@ -384,11 +384,11 @@ discard block |
||
| 384 | 384 | $process = 'AUTO' |
| 385 | 385 | ) { |
| 386 | 386 | // PHP 7+ type hint |
| 387 | - $img = (string)$img; |
|
| 388 | - $taille_x = (int)$taille_x; |
|
| 389 | - $taille_y = (int)$taille_y; |
|
| 390 | - $force = (bool)$force; |
|
| 391 | - $process = (string)$process; |
|
| 387 | + $img = (string) $img; |
|
| 388 | + $taille_x = (int) $taille_x; |
|
| 389 | + $taille_y = (int) $taille_y; |
|
| 390 | + $force = (bool) $force; |
|
| 391 | + $process = (string) $process; |
|
| 392 | 392 | |
| 393 | 393 | if (!$img) { |
| 394 | 394 | return ''; |
@@ -465,11 +465,11 @@ discard block |
||
| 465 | 465 | $process = 'AUTO' |
| 466 | 466 | ) { |
| 467 | 467 | // PHP 7+ type hint |
| 468 | - $img = (string)$img; |
|
| 469 | - $taille = (int)$taille; |
|
| 470 | - $taille_y = (int)$taille_y; |
|
| 471 | - $force = (bool)$force; |
|
| 472 | - $process = (string)$process; |
|
| 468 | + $img = (string) $img; |
|
| 469 | + $taille = (int) $taille; |
|
| 470 | + $taille_y = (int) $taille_y; |
|
| 471 | + $force = (bool) $force; |
|
| 472 | + $process = (string) $process; |
|
| 473 | 473 | |
| 474 | 474 | // Determiner la taille x,y maxi |
| 475 | 475 | // prendre le reglage de previsu par defaut |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | * sinon retourne le image_passe_partout usuel |
| 505 | 505 | * |
| 506 | 506 | **/ |
| 507 | -function image_recadre_avec_fallback ( |
|
| 507 | +function image_recadre_avec_fallback( |
|
| 508 | 508 | $im, |
| 509 | 509 | $width, |
| 510 | 510 | $height = '-', |
@@ -533,9 +533,9 @@ discard block |
||
| 533 | 533 | **/ |
| 534 | 534 | function image_reduire_par($img, $val = 1, $force = false) { |
| 535 | 535 | // PHP 7+ type hint |
| 536 | - $img = (string)$img; |
|
| 537 | - $val = (int)$val; |
|
| 538 | - $force = (bool)$force; |
|
| 536 | + $img = (string) $img; |
|
| 537 | + $val = (int) $val; |
|
| 538 | + $force = (bool) $force; |
|
| 539 | 539 | |
| 540 | 540 | list($hauteur, $largeur) = taille_image($img); |
| 541 | 541 | |
@@ -47,14 +47,14 @@ discard block |
||
| 47 | 47 | $je_suis_poste = $flux['args']['je_suis_poste']; |
| 48 | 48 | |
| 49 | 49 | $cle_autosave = serialize($cle_autosave); |
| 50 | - $cle_autosave = $form . "_" . md5($cle_autosave); |
|
| 50 | + $cle_autosave = $form."_".md5($cle_autosave); |
|
| 51 | 51 | |
| 52 | 52 | // si on a un backup en session et qu'on est au premier chargement, non poste |
| 53 | 53 | // on restitue les donnees |
| 54 | - if (isset($GLOBALS['visiteur_session']['session_autosave_' . $cle_autosave]) |
|
| 54 | + if (isset($GLOBALS['visiteur_session']['session_autosave_'.$cle_autosave]) |
|
| 55 | 55 | and !$je_suis_poste |
| 56 | 56 | ) { |
| 57 | - parse_str($GLOBALS['visiteur_session']['session_autosave_' . $cle_autosave], $vars); |
|
| 57 | + parse_str($GLOBALS['visiteur_session']['session_autosave_'.$cle_autosave], $vars); |
|
| 58 | 58 | foreach ($vars as $key => $val) { |
| 59 | 59 | if (isset($flux['data'][$key])) { |
| 60 | 60 | $flux['data'][$key] = (is_string($val) ? autosave_clean_value($val) : array_map('autosave_clean_value', |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | if ($je_suis_poste and _request('autosave') === $cle_autosave and function_exists('terminer_actualiser_sessions')) { |
| 69 | 69 | terminer_actualiser_sessions(); |
| 70 | 70 | // et verifions si jamais l'autosave a fait un come back, dans ce cas on le revide |
| 71 | - if (isset($GLOBALS['visiteur_session']['session_autosave_' . $cle_autosave])) { |
|
| 72 | - session_set('session_autosave_' . $cle_autosave, null); |
|
| 71 | + if (isset($GLOBALS['visiteur_session']['session_autosave_'.$cle_autosave])) { |
|
| 72 | + session_set('session_autosave_'.$cle_autosave, null); |
|
| 73 | 73 | // en court sleep pour etre certain que la concurrence est finie |
| 74 | 74 | sleep(1); |
| 75 | 75 | terminer_actualiser_sessions(); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | $flux['data']['_hidden'] .= "<input type='hidden' name='autosave' class='autosaveactive' value='$cle_autosave' />" |
| 84 | 84 | . '<script type="text/javascript">/*<![CDATA[*/if (window.jQuery) jQuery(function(){ |
| 85 | - $("input.autosaveactive").closest("form:not(.autosaveon)").autosave({url:"' . $GLOBALS['meta']['adresse_site'] . '/"}).addClass("autosaveon"); |
|
| 85 | + $("input.autosaveactive").closest("form:not(.autosaveon)").autosave({url:"' . $GLOBALS['meta']['adresse_site'].'/"}).addClass("autosaveon"); |
|
| 86 | 86 | });/*]]>*/</script>'; |
| 87 | 87 | |
| 88 | 88 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | // on elimine les donnees de la session |
| 106 | 106 | if ($cle_autosave = _request('autosave')) { |
| 107 | 107 | include_spip('inc/session'); |
| 108 | - session_set('session_autosave_' . $cle_autosave, null); |
|
| 108 | + session_set('session_autosave_'.$cle_autosave, null); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | if (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']) { |
@@ -33,17 +33,17 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | function ranger_cache_gd2() { |
| 35 | 35 | spip_log("ranger_cache_gd2"); |
| 36 | - $base = _DIR_VAR . "cache-gd2/"; |
|
| 36 | + $base = _DIR_VAR."cache-gd2/"; |
|
| 37 | 37 | if (is_dir($base) and is_readable($base)) { |
| 38 | 38 | if ($dir = opendir($base)) { |
| 39 | 39 | while (($f = readdir($dir)) !== false) { |
| 40 | - if (!is_dir($base . $f) and strncmp($f, ".", 1) !== 0 |
|
| 40 | + if (!is_dir($base.$f) and strncmp($f, ".", 1) !== 0 |
|
| 41 | 41 | and preg_match(",[0-9a-f]{32}\.\w+,", $f) |
| 42 | 42 | ) { |
| 43 | 43 | $sub = substr($f, 0, 2); |
| 44 | 44 | $sub = sous_repertoire($base, $sub); |
| 45 | - @rename($base . $f, $sub . substr($f, 2)); |
|
| 46 | - @unlink($base . $f); // au cas ou le rename a foire (collision) |
|
| 45 | + @rename($base.$f, $sub.substr($f, 2)); |
|
| 46 | + @unlink($base.$f); // au cas ou le rename a foire (collision) |
|
| 47 | 47 | } |
| 48 | 48 | if (time() >= _TIME_OUT) { |
| 49 | 49 | return; |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | $exceptions_pluriel = array('forum' => 'forum', 'syndic' => 'syndic'); |
| 61 | 61 | |
| 62 | 62 | $pivot = preg_replace(',[^\w],', '', $pivot); // securite |
| 63 | - $pivots = (isset($exceptions_pluriel[$pivot]) ? $exceptions_pluriel[$pivot] : $pivot . "s"); |
|
| 64 | - $liens = "spip_" . $pivots . "_liens"; |
|
| 65 | - $id_pivot = "id_" . $pivot; |
|
| 63 | + $pivots = (isset($exceptions_pluriel[$pivot]) ? $exceptions_pluriel[$pivot] : $pivot."s"); |
|
| 64 | + $liens = "spip_".$pivots."_liens"; |
|
| 65 | + $id_pivot = "id_".$pivot; |
|
| 66 | 66 | // Creer spip_auteurs_liens |
| 67 | 67 | global $tables_auxiliaires; |
| 68 | 68 | if (!$l) { |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | $l = preg_replace(',[^\w],', '', $l); // securite |
| 75 | 75 | $primary = "id_$l"; |
| 76 | 76 | $objet = ($l == 'syndic' ? 'site' : $l); |
| 77 | - $ls = (isset($exceptions_pluriel[$l]) ? $exceptions_pluriel[$l] : $l . "s"); |
|
| 78 | - $ancienne_table = 'spip_' . $pivots . '_' . $ls; |
|
| 77 | + $ls = (isset($exceptions_pluriel[$l]) ? $exceptions_pluriel[$l] : $l."s"); |
|
| 78 | + $ancienne_table = 'spip_'.$pivots.'_'.$ls; |
|
| 79 | 79 | $pool = 400; |
| 80 | 80 | |
| 81 | 81 | $trouver_table = charger_fonction('trouver_table', 'base'); |
@@ -111,12 +111,12 @@ discard block |
||
| 111 | 111 | while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) { |
| 112 | 112 | $insert = array(); |
| 113 | 113 | foreach ($ids as $id) { |
| 114 | - $n = sql_countsel($liens, "objet='$objet' AND id_objet=" . intval($id)); |
|
| 115 | - while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . intval($id), '', $id_pivot, "$n,$pool")) { |
|
| 114 | + $n = sql_countsel($liens, "objet='$objet' AND id_objet=".intval($id)); |
|
| 115 | + while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=".intval($id), '', $id_pivot, "$n,$pool")) { |
|
| 116 | 116 | $n += count($t); |
| 117 | 117 | // empiler en s'assurant a minima de l'unicite |
| 118 | 118 | while ($r = array_shift($t)) { |
| 119 | - $insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r; |
|
| 119 | + $insert[$r[$id_pivot].':'.$r['id_objet']] = $r; |
|
| 120 | 120 | } |
| 121 | 121 | if (count($insert) >= $sub_pool) { |
| 122 | 122 | maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]); |
@@ -263,13 +263,13 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | // cas particulier spip_auteurs : retablir le collate binary sur le login |
| 265 | 265 | $desc = $trouver_table("spip_auteurs"); |
| 266 | - spip_log("spip_auteurs : " . var_export($desc['field'], true), "maj." . _LOG_INFO_IMPORTANTE); |
|
| 266 | + spip_log("spip_auteurs : ".var_export($desc['field'], true), "maj."._LOG_INFO_IMPORTANTE); |
|
| 267 | 267 | if (stripos($desc['field']['login'], "BINARY") === false) { |
| 268 | 268 | spip_log("Retablir champ login BINARY sur table spip_auteurs", "maj"); |
| 269 | 269 | sql_alter("table spip_auteurs change login login VARCHAR(255) BINARY"); |
| 270 | 270 | $trouver_table(''); |
| 271 | 271 | $new_desc = $trouver_table("spip_auteurs"); |
| 272 | - spip_log("Apres conversion spip_auteurs : " . var_export($new_desc['field'], true), "maj." . _LOG_INFO_IMPORTANTE); |
|
| 272 | + spip_log("Apres conversion spip_auteurs : ".var_export($new_desc['field'], true), "maj."._LOG_INFO_IMPORTANTE); |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | foreach ($tables as $table) { |
@@ -288,24 +288,24 @@ discard block |
||
| 288 | 288 | $data = sql_allfetsel("*", "spip_urls", '', '', 'date DESC'); |
| 289 | 289 | $urls = array(); |
| 290 | 290 | foreach ($data as $d) { |
| 291 | - $key = $d['id_parent'] . "::" . strtolower($d['url']); |
|
| 291 | + $key = $d['id_parent']."::".strtolower($d['url']); |
|
| 292 | 292 | if (!isset($urls[$key])) { |
| 293 | 293 | $urls[$key] = true; |
| 294 | 294 | } else { |
| 295 | - spip_log("Suppression doublon dans spip_urls avant conversion : " . serialize($d), |
|
| 296 | - "maj." . _LOG_INFO_IMPORTANTE); |
|
| 297 | - sql_delete("spip_urls", "id_parent=" . sql_quote($d['id_parent']) . " AND url=" . sql_quote($d['url'])); |
|
| 295 | + spip_log("Suppression doublon dans spip_urls avant conversion : ".serialize($d), |
|
| 296 | + "maj."._LOG_INFO_IMPORTANTE); |
|
| 297 | + sql_delete("spip_urls", "id_parent=".sql_quote($d['id_parent'])." AND url=".sql_quote($d['url'])); |
|
| 298 | 298 | } |
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | foreach ($desc['field'] as $field => $type) { |
| 302 | 302 | if ($desc['field'][$field] !== $desc_collate[$field]) { |
| 303 | - spip_log("Conversion COLLATE table $table", "maj." . _LOG_INFO_IMPORTANTE); |
|
| 304 | - sql_alter("table $table change $field $field " . $desc_collate[$field]); |
|
| 303 | + spip_log("Conversion COLLATE table $table", "maj."._LOG_INFO_IMPORTANTE); |
|
| 304 | + sql_alter("table $table change $field $field ".$desc_collate[$field]); |
|
| 305 | 305 | $trouver_table(''); |
| 306 | 306 | $new_desc = $trouver_table($table); |
| 307 | - spip_log("Apres conversion $table : " . var_export($new_desc['field'], true), |
|
| 308 | - "maj." . _LOG_INFO_IMPORTANTE); |
|
| 307 | + spip_log("Apres conversion $table : ".var_export($new_desc['field'], true), |
|
| 308 | + "maj."._LOG_INFO_IMPORTANTE); |
|
| 309 | 309 | continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite |
| 310 | 310 | } |
| 311 | 311 | } |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | $GLOBALS['maj'][19236] = array( |
| 323 | 323 | array('sql_updateq', 'spip_meta', array('impt' => 'oui'), "nom='version_installee'"), // version base principale |
| 324 | - array('sql_updateq', 'spip_meta', array('impt' => 'oui'), "nom LIKE '%_base_version'"), // version base plugins |
|
| 324 | + array('sql_updateq', 'spip_meta', array('impt' => 'oui'), "nom LIKE '%_base_version'"), // version base plugins |
|
| 325 | 325 | array('maj_collation_sqlite'), |
| 326 | 326 | ); |
| 327 | 327 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | spip_log("supprimer sessions auteur"); |
| 339 | 339 | if ($dir = opendir(_DIR_SESSIONS)) { |
| 340 | 340 | while (($f = readdir($dir)) !== false) { |
| 341 | - spip_unlink(_DIR_SESSIONS . $f); |
|
| 341 | + spip_unlink(_DIR_SESSIONS.$f); |
|
| 342 | 342 | if (time() >= _TIME_OUT) { |
| 343 | 343 | return; |
| 344 | 344 | } |
@@ -64,12 +64,12 @@ |
||
| 64 | 64 | spip_log("Table $table TIMESTAMP incorrect", "maj"); |
| 65 | 65 | foreach ($desc['field'] as $field => $type) { |
| 66 | 66 | if ($desc['field'][$field] !== $fields_corrected[$field]) { |
| 67 | - spip_log("Adaptation TIMESTAMP table $table", "maj." . _LOG_INFO_IMPORTANTE); |
|
| 68 | - sql_alter("table $table change $field $field " . $fields_corrected[$field]); |
|
| 67 | + spip_log("Adaptation TIMESTAMP table $table", "maj."._LOG_INFO_IMPORTANTE); |
|
| 68 | + sql_alter("table $table change $field $field ".$fields_corrected[$field]); |
|
| 69 | 69 | $trouver_table(''); |
| 70 | 70 | $new_desc = $trouver_table($table); |
| 71 | - spip_log("Apres conversion $table : " . var_export($new_desc['field'], true), |
|
| 72 | - "maj." . _LOG_INFO_IMPORTANTE); |
|
| 71 | + spip_log("Apres conversion $table : ".var_export($new_desc['field'], true), |
|
| 72 | + "maj."._LOG_INFO_IMPORTANTE); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if ($GLOBALS['spip_version_base'] != $GLOBALS['meta']['version_installee']) { |
| 57 | 57 | if (!is_numeric(_request('reinstall'))) { |
| 58 | 58 | include_spip('base/create'); |
| 59 | - spip_log('recree les tables eventuellement disparues', 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 59 | + spip_log('recree les tables eventuellement disparues', 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 60 | 60 | creer_base(); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | exit; |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | - spip_log('Fin de mise a jour SQL. Debut m-a-j acces et config', 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 72 | + spip_log('Fin de mise a jour SQL. Debut m-a-j acces et config', 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 73 | 73 | |
| 74 | 74 | // supprimer quelques fichiers temporaires qui peuvent se retrouver invalides |
| 75 | 75 | @spip_unlink(_CACHE_RUBRIQUES); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | @spip_unlink(_CACHE_PLUGINS_OPT); |
| 79 | 79 | @spip_unlink(_CACHE_PLUGINS_FCT); |
| 80 | 80 | @spip_unlink(_CACHE_CHEMIN); |
| 81 | - @spip_unlink(_DIR_TMP . 'plugin_xml_cache.gz'); |
|
| 81 | + @spip_unlink(_DIR_TMP.'plugin_xml_cache.gz'); |
|
| 82 | 82 | |
| 83 | 83 | include_spip('inc/auth'); |
| 84 | 84 | auth_synchroniser_distant(); |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $version_installee = $GLOBALS['meta']['version_installee'] ?? null; |
| 118 | 118 | |
| 119 | 119 | spip_log( |
| 120 | - "Version anterieure: $version_installee. Courante: " . $GLOBALS['spip_version_base'], |
|
| 121 | - 'maj.' . _LOG_INFO_IMPORTANTE |
|
| 120 | + "Version anterieure: $version_installee. Courante: ".$GLOBALS['spip_version_base'], |
|
| 121 | + 'maj.'._LOG_INFO_IMPORTANTE |
|
| 122 | 122 | ); |
| 123 | 123 | if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) { |
| 124 | 124 | sql_replace( |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | $res = maj_while($version_installee, $cible, $GLOBALS['maj'], 'version_installee', 'meta', $redirect, $debut_page); |
| 152 | 152 | if ($res) { |
| 153 | 153 | if (!is_array($res)) { |
| 154 | - spip_log("Pb d'acces SQL a la mise a jour", 'maj.' . _LOG_INFO_ERREUR); |
|
| 154 | + spip_log("Pb d'acces SQL a la mise a jour", 'maj.'._LOG_INFO_ERREUR); |
|
| 155 | 155 | } else { |
| 156 | - echo _T('avis_operation_echec') . ' ' . join(' ', $res); |
|
| 156 | + echo _T('avis_operation_echec').' '.join(' ', $res); |
|
| 157 | 157 | echo install_fin_html(); |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -240,9 +240,9 @@ discard block |
||
| 240 | 240 | $res = maj_while($current_version, $version_cible, $maj, $nom_meta_base_version, $table_meta, $redirect); |
| 241 | 241 | if ($res) { |
| 242 | 242 | if (!is_array($res)) { |
| 243 | - spip_log("Pb d'acces SQL a la mise a jour", 'maj.' . _LOG_INFO_ERREUR); |
|
| 243 | + spip_log("Pb d'acces SQL a la mise a jour", 'maj.'._LOG_INFO_ERREUR); |
|
| 244 | 244 | } else { |
| 245 | - echo '<p>' . _T('avis_operation_echec') . ' ' . join(' ', $res) . '</p>'; |
|
| 245 | + echo '<p>'._T('avis_operation_echec').' '.join(' ', $res).'</p>'; |
|
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | } |
@@ -294,11 +294,11 @@ discard block |
||
| 294 | 294 | $timeout = _UPGRADE_TIME_OUT * 2; |
| 295 | 295 | $titre = _T('titre_page_upgrade'); |
| 296 | 296 | $balise_img = charger_filtre('balise_img'); |
| 297 | - $titre .= $balise_img(chemin_image('loader.svg'),'','loader'); |
|
| 297 | + $titre .= $balise_img(chemin_image('loader.svg'), '', 'loader'); |
|
| 298 | 298 | echo(install_debut_html($titre)); |
| 299 | 299 | // script de rechargement auto sur timeout |
| 300 | 300 | $redirect = generer_url_ecrire('upgrade', "reinstall=$installee&meta=$meta&table=$table", true); |
| 301 | - echo http_script("window.setTimeout('location.href=\"" . $redirect . "\";'," . ($timeout * 1000) . ')'); |
|
| 301 | + echo http_script("window.setTimeout('location.href=\"".$redirect."\";',".($timeout * 1000).')'); |
|
| 302 | 302 | echo "<div style='text-align: left'>\n"; |
| 303 | 303 | if (ob_get_level()) { |
| 304 | 304 | ob_flush(); |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | return array($v, $etape); |
| 387 | 387 | } |
| 388 | 388 | $n = time() - $time; |
| 389 | - spip_log("$table $meta: $v en $n secondes", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 389 | + spip_log("$table $meta: $v en $n secondes", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 390 | 390 | if ($meta) { |
| 391 | 391 | ecrire_meta($meta, $installee = $v, 'oui', $table); |
| 392 | 392 | } |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | if ($meta) { |
| 403 | 403 | ecrire_meta($meta, $cible, 'oui', $table); |
| 404 | 404 | } |
| 405 | - spip_log("MAJ terminee. $meta: $installee", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 405 | + spip_log("MAJ terminee. $meta: $installee", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 406 | 406 | |
| 407 | 407 | return array(); |
| 408 | 408 | } |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | * @return int |
| 428 | 428 | */ |
| 429 | 429 | function serie_alter($serie, $q = array(), $meta = '', $table = 'meta', $redirect = '') { |
| 430 | - $meta2 = $meta . '_maj_' . $serie; |
|
| 430 | + $meta2 = $meta.'_maj_'.$serie; |
|
| 431 | 431 | $etape = 0; |
| 432 | 432 | if (isset($GLOBALS[$table][$meta2])) { |
| 433 | 433 | $etape = intval($GLOBALS[$table][$meta2]); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | and function_exists($f = array_shift($r)) |
| 440 | 440 | ) { |
| 441 | 441 | // note: $r (arguments de la fonction $f) peut avoir des données tabulaires |
| 442 | - spip_log("$msg: $f " . @join(',', $r), 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 442 | + spip_log("$msg: $f ".@join(',', $r), 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 443 | 443 | // pour les fonctions atomiques sql_xx |
| 444 | 444 | // on enregistre le meta avant de lancer la fonction, |
| 445 | 445 | // de maniere a eviter de boucler sur timeout |
@@ -457,12 +457,12 @@ discard block |
||
| 457 | 457 | relance_maj($meta, $table, $redirect); |
| 458 | 458 | } |
| 459 | 459 | ecrire_meta($meta2, $i + 1, 'non', $table); |
| 460 | - spip_log("$meta2: ok", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 460 | + spip_log("$meta2: ok", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 461 | 461 | } else { |
| 462 | 462 | if (!is_array($r)) { |
| 463 | - spip_log("maj $i format incorrect", 'maj.' . _LOG_ERREUR); |
|
| 463 | + spip_log("maj $i format incorrect", 'maj.'._LOG_ERREUR); |
|
| 464 | 464 | } else { |
| 465 | - spip_log("maj $i fonction $f non definie", 'maj.' . _LOG_ERREUR); |
|
| 465 | + spip_log("maj $i fonction $f non definie", 'maj.'._LOG_ERREUR); |
|
| 466 | 466 | } |
| 467 | 467 | // en cas d'erreur serieuse, on s'arrete |
| 468 | 468 | // mais on permet de passer par dessus en rechargeant la page. |