@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $coupe_url = defined('_MAX_COUPE_URL') ? _MAX_COUPE_URL : 35; |
| 27 | 27 | |
| 28 | 28 | if (strlen($url) > $long_url) { |
| 29 | - $url = substr($url, 0, $coupe_url) . '...'; |
|
| 29 | + $url = substr($url, 0, $coupe_url).'...'; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | return $url; |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // si spip_log() dans mes_options, ou repertoire log/ non present, poser dans tmp/ |
| 54 | 54 | if (!defined('_DIR_LOG') or !$test_repertoire[$d]) { |
| 55 | - $logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log'; |
|
| 55 | + $logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $rotate = 0; |
| 59 | - $pid = '(pid ' . @getmypid() . ')'; |
|
| 59 | + $pid = '(pid '.@getmypid().')'; |
|
| 60 | 60 | |
| 61 | 61 | // accepter spip_log( Array ) |
| 62 | 62 | if (!is_string($message)) { |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | $fi = substr($fi, strlen(_ROOT_RACINE)); |
| 72 | 72 | } |
| 73 | 73 | $fu = isset($debug[2]['function']) ? $debug[2]['function'] : ''; |
| 74 | - $debugverb = "$fi:L$l:$fu" . '():'; |
|
| 74 | + $debugverb = "$fi:L$l:$fu".'():'; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $m = date('Y-m-d H:i:s') . ' ' . (isset($GLOBALS['ip']) ? $GLOBALS['ip'] : '') . ' ' . $pid . ' ' |
|
| 77 | + $m = date('Y-m-d H:i:s').' '.(isset($GLOBALS['ip']) ? $GLOBALS['ip'] : '').' '.$pid.' ' |
|
| 78 | 78 | //distinguer les logs prives et publics dans les grep |
| 79 | 79 | . $debugverb |
| 80 | 80 | . (test_espace_prive() ? ':Pri:' : ':Pub:') |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | if ($rotate-- > 0 |
| 98 | 98 | and function_exists('spip_unlink') |
| 99 | 99 | ) { |
| 100 | - spip_unlink($logfile . '.' . $rotate); |
|
| 100 | + spip_unlink($logfile.'.'.$rotate); |
|
| 101 | 101 | while ($rotate--) { |
| 102 | - @rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1)); |
|
| 102 | + @rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1)); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | if (!$max_age) { |
| 107 | 107 | $max_age = _DEFAULT_LOCKTIME; |
| 108 | 108 | } |
| 109 | - $lock_file = _DIR_TMP . _NAME_LOCK . '-' . substr(md5($fichier), 0, 8); |
|
| 109 | + $lock_file = _DIR_TMP._NAME_LOCK.'-'.substr(md5($fichier), 0, 8); |
|
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | /* |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | |
| 117 | 117 | $id = creer_uniqid(); |
| 118 | - $tpath = _DIR_TMP . "slock.$id"; |
|
| 118 | + $tpath = _DIR_TMP."slock.$id"; |
|
| 119 | 119 | $tmpfd = @fopen($tpath, 'w'); // hum, le 'x' necessite php4,3,2 ... |
| 120 | 120 | if (!$tmpfd) { /* open failed */ |
| 121 | 121 | @fclose($tmpfd); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * thinks the current time is (our_tmp.st_ctime).. |
| 242 | 242 | */ |
| 243 | 243 | |
| 244 | - $tpath = _DIR_TMP . "stime.$id"; |
|
| 244 | + $tpath = _DIR_TMP."stime.$id"; |
|
| 245 | 245 | $tmpfd = @fopen($tpath, 'w'); |
| 246 | 246 | if ((!$tmpfd) |
| 247 | 247 | or (@fputs($tmpfd, 'zz', 2) != 2) |
@@ -254,14 +254,14 @@ discard block |
||
| 254 | 254 | return false; //(NFSL_SYSF); |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - @fclose($tmpfd); /* We don't need this once we have our_tmp.st_ctime. */ |
|
| 257 | + @fclose($tmpfd); /* We don't need this once we have our_tmp.st_ctime. */ |
|
| 258 | 258 | spip_unlink($tpath); |
| 259 | 259 | |
| 260 | 260 | /* |
| 261 | 261 | * 2. make fullpath, a buffer for the full pathname of the lock file |
| 262 | 262 | */ |
| 263 | 263 | |
| 264 | - $lock_file = _DIR_TMP . _NAME_LOCK . '-' . substr(md5($fichier), 0, 8); |
|
| 264 | + $lock_file = _DIR_TMP._NAME_LOCK.'-'.substr(md5($fichier), 0, 8); |
|
| 265 | 265 | |
| 266 | 266 | /* |
| 267 | 267 | * 3. If the ctime hasn't been modified, unlink the file and return. If the |
@@ -280,10 +280,10 @@ discard block |
||
| 280 | 280 | if (!$test) { |
| 281 | 281 | return false; |
| 282 | 282 | } //(NFSL_LOST); |
| 283 | - sleep(1 + (random(0, 4))); /* so sleep a bit */ |
|
| 283 | + sleep(1 + (random(0, 4))); /* so sleep a bit */ |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | - return true;//(NFSL_OK); /* success */ |
|
| 286 | + return true; //(NFSL_OK); /* success */ |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /* |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $role = $roles['roles']['defaut']; |
| 150 | 150 | } |
| 151 | 151 | // where |
| 152 | - $cond = array("$colonne_role=" . sql_quote($role)); |
|
| 152 | + $cond = array("$colonne_role=".sql_quote($role)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | return array($role, $colonne_role, $cond); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | if ($colonne_role) { |
| 185 | 185 | // on ajoute la condition du role aux autres conditions. |
| 186 | 186 | if ($role != '*') { |
| 187 | - $cond[] = "$colonne_role=" . sql_quote($role); |
|
| 187 | + $cond[] = "$colonne_role=".sql_quote($role); |
|
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | $all = sql_allfetsel( |
| 369 | 369 | "DISTINCT $colone_role", |
| 370 | 370 | $l, |
| 371 | - 'objet=' . sql_quote(($objet_source == $objet_lien) ? $objet : $objet_source) |
|
| 371 | + 'objet='.sql_quote(($objet_source == $objet_lien) ? $objet : $objet_source) |
|
| 372 | 372 | ); |
| 373 | 373 | $done[$hash] = array_map('reset', $all); |
| 374 | 374 | |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | $namespace[null] = null; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $name = strtolower((string)$obj->getName()); |
|
| 61 | - $text = trim((string)$obj); |
|
| 60 | + $name = strtolower((string) $obj->getName()); |
|
| 61 | + $text = trim((string) $obj); |
|
| 62 | 62 | if (strlen($text) <= 0) { |
| 63 | 63 | $text = null; |
| 64 | 64 | } |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | // attributes |
| 72 | 72 | $objAttributes = $obj->attributes($ns, true); |
| 73 | 73 | foreach ($objAttributes as $attributeName => $attributeValue) { |
| 74 | - $attribName = strtolower(trim((string)$attributeName)); |
|
| 75 | - $attribVal = trim((string)$attributeValue); |
|
| 74 | + $attribName = strtolower(trim((string) $attributeName)); |
|
| 75 | + $attribVal = trim((string) $attributeValue); |
|
| 76 | 76 | if (!empty($ns)) { |
| 77 | - $attribName = $ns . ':' . $attribName; |
|
| 77 | + $attribName = $ns.':'.$attribName; |
|
| 78 | 78 | } |
| 79 | 79 | $attributes[$attribName] = $attribVal; |
| 80 | 80 | } |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | // children |
| 83 | 83 | $objChildren = $obj->children($ns, true); |
| 84 | 84 | foreach ($objChildren as $childName => $child) { |
| 85 | - $childName = strtolower((string)$childName); |
|
| 85 | + $childName = strtolower((string) $childName); |
|
| 86 | 86 | if (!empty($ns)) { |
| 87 | - $childName = $ns . ':' . $childName; |
|
| 87 | + $childName = $ns.':'.$childName; |
|
| 88 | 88 | } |
| 89 | 89 | $children[$childName][] = xmlObjToArr($child, $namespace); |
| 90 | 90 | } |
@@ -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,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | $flux['data']['_hidden'] .= "<input type='hidden' name='autosave' class='autosaveactive' value='$cle_autosave' />" |
| 70 | 70 | . '<script type="text/javascript">/*<![CDATA[*/if (window.jQuery) jQuery(function(){ |
| 71 | - $("input.autosaveactive").closest("form:not(.autosaveon)").autosave({url:"' . $GLOBALS['meta']['adresse_site'] . '/"}).addClass("autosaveon"); |
|
| 71 | + $("input.autosaveactive").closest("form:not(.autosaveon)").autosave({url:"' . $GLOBALS['meta']['adresse_site'].'/"}).addClass("autosaveon"); |
|
| 72 | 72 | });/*]]>*/</script>'; |
| 73 | 73 | |
| 74 | 74 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | // on elimine les donnees de la session |
| 92 | 92 | if ($cle_autosave = _request('autosave')) { |
| 93 | 93 | include_spip('inc/session'); |
| 94 | - session_set('session_autosave_' . $cle_autosave, null); |
|
| 94 | + session_set('session_autosave_'.$cle_autosave, null); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | if (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']) { |
@@ -45,12 +45,12 @@ |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $fond = "prive/objets/liste/$vue"; |
| 48 | - if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) { |
|
| 48 | + if (!find_in_path($fond."."._EXTENSION_SQUELETTES)) { |
|
| 49 | 49 | // traiter les cas particuliers |
| 50 | 50 | include_spip('base/connect_sql'); |
| 51 | 51 | $vue = table_objet($vue); |
| 52 | 52 | $fond = "prive/objets/liste/$vue"; |
| 53 | - if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) { |
|
| 53 | + if (!find_in_path($fond."."._EXTENSION_SQUELETTES)) { |
|
| 54 | 54 | return _L("vue $vue introuvable pour lister les objets"); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | -require_once _ROOT_RESTREINT . 'base/objets.php'; |
|
| 21 | +require_once _ROOT_RESTREINT.'base/objets.php'; |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $f = (!preg_match('/^[\w\.]*$/', $serveur)) |
| 60 | 60 | ? '' // nom de serveur mal ecrit |
| 61 | 61 | : ($serveur ? |
| 62 | - (_DIR_CONNECT . $serveur . '.php') // serveur externe |
|
| 62 | + (_DIR_CONNECT.$serveur.'.php') // serveur externe |
|
| 63 | 63 | : (_FILE_CONNECT ? _FILE_CONNECT // serveur principal ok |
| 64 | 64 | : ($install ? _FILE_CONNECT_TMP // init du serveur principal |
| 65 | 65 | : ''))); // installation pas faite |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | // chargement de la version du jeu de fonctions |
| 103 | 103 | // si pas dans le fichier par defaut |
| 104 | 104 | $type = $GLOBALS['db_ok']['type']; |
| 105 | - $jeu = 'spip_' . $type . '_functions_' . $version; |
|
| 105 | + $jeu = 'spip_'.$type.'_functions_'.$version; |
|
| 106 | 106 | if (!isset($GLOBALS[$jeu])) { |
| 107 | - if (!find_in_path($type . '_' . $version . '.php', 'req/', true)) { |
|
| 107 | + if (!find_in_path($type.'_'.$version.'.php', 'req/', true)) { |
|
| 108 | 108 | spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS); |
| 109 | 109 | |
| 110 | 110 | // ne plus reessayer |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | $connexion = spip_connect($serveur); |
| 166 | 166 | $e = sql_errno($serveur); |
| 167 | 167 | $t = (isset($connexion['type']) ? $connexion['type'] : 'sql'); |
| 168 | - $m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']); |
|
| 169 | - $f = $t . $serveur; |
|
| 170 | - spip_log($m, $f . '.' . _LOG_ERREUR); |
|
| 168 | + $m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']); |
|
| 169 | + $f = $t.$serveur; |
|
| 170 | + spip_log($m, $f.'.'._LOG_ERREUR); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | // si en cours d'installation ou si db=@test@ on ne pose rien |
| 250 | 250 | // car c'est un test de connexion |
| 251 | 251 | if (!defined('_ECRIRE_INSTALL') and $db !== "@test@") { |
| 252 | - $f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out'; |
|
| 252 | + $f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out'; |
|
| 253 | 253 | } elseif ($db == '@test@') { |
| 254 | 254 | $db = ''; |
| 255 | 255 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | // En cas d'indisponibilite du serveur, eviter de le bombarder |
| 290 | 290 | if ($f) { |
| 291 | 291 | @touch($f); |
| 292 | - spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS); |
|
| 292 | + spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS); |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | |
@@ -379,8 +379,7 @@ discard block |
||
| 379 | 379 | * @return string Valeur échappée. |
| 380 | 380 | **/ |
| 381 | 381 | function _q($a) { |
| 382 | - return (is_numeric($a)) ? strval($a) : |
|
| 383 | - (!is_array($a) ? ("'" . addslashes($a) . "'") |
|
| 382 | + return (is_numeric($a)) ? strval($a) : (!is_array($a) ? ("'".addslashes($a)."'") |
|
| 384 | 383 | : join(",", array_map('_q', $a))); |
| 385 | 384 | } |
| 386 | 385 | |
@@ -452,7 +451,7 @@ discard block |
||
| 452 | 451 | break; |
| 453 | 452 | default: |
| 454 | 453 | $replace = range(1, count($textes)); |
| 455 | - $replace = '%' . implode('$s,%', $replace) . '$s'; |
|
| 454 | + $replace = '%'.implode('$s,%', $replace).'$s'; |
|
| 456 | 455 | $replace = explode(',', $replace); |
| 457 | 456 | break; |
| 458 | 457 | } |
@@ -51,5 +51,5 @@ |
||
| 51 | 51 | } |
| 52 | 52 | $d = count($delete); |
| 53 | 53 | $r = count($res); |
| 54 | - spip_log("Tables detruites: $r sur $d: " . join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 54 | + spip_log("Tables detruites: $r sur $d: ".join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 55 | 55 | } |