Completed
Push — master ( 4191b0...9e95bf )
by cam
01:25 queued 23s
created
ecrire/base/connect_sql.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 if (!defined('_ECRIRE_INC_VERSION')) {
18 18
 	return;
19 19
 }
20
-require_once _ROOT_RESTREINT . 'base/objets.php';
20
+require_once _ROOT_RESTREINT.'base/objets.php';
21 21
 
22 22
 
23 23
 /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			// serveur externe et nom de serveur bien ecrit ?
61 61
 			if (defined('_DIR_CONNECT')
62 62
 				and preg_match('/^[\w\.]*$/', $serveur)) {
63
-				$f = _DIR_CONNECT . $serveur . '.php';
63
+				$f = _DIR_CONNECT.$serveur.'.php';
64 64
 				if (!is_readable($f) and !$install) {
65 65
 					// chercher une declaration de serveur dans le path
66 66
 					// qui peut servir à des plugins à declarer des connexions à une base sqlite
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 	// chargement de la version du jeu de fonctions
111 111
 	// si pas dans le fichier par defaut
112 112
 	$type = $GLOBALS['db_ok']['type'];
113
-	$jeu = 'spip_' . $type . '_functions_' . $version;
113
+	$jeu = 'spip_'.$type.'_functions_'.$version;
114 114
 	if (!isset($GLOBALS[$jeu])) {
115
-		if (!find_in_path($type . '_' . $version . '.php', 'req/', true)) {
115
+		if (!find_in_path($type.'_'.$version.'.php', 'req/', true)) {
116 116
 			spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS);
117 117
 
118 118
 			// ne plus reessayer
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
 	$connexion = spip_connect($serveur);
175 175
 	$e = sql_errno($serveur);
176 176
 	$t = ($connexion['type'] ?? 'sql');
177
-	$m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']);
178
-	$f = $t . $serveur;
179
-	spip_log($m, $f . '.' . _LOG_ERREUR);
177
+	$m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']);
178
+	$f = $t.$serveur;
179
+	spip_log($m, $f.'.'._LOG_ERREUR);
180 180
 }
181 181
 
182 182
 /**
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	// si en cours d'installation ou si db=@test@ on ne pose rien
263 263
 	// car c'est un test de connexion
264 264
 	if (!defined('_ECRIRE_INSTALL') and $db !== '@test@') {
265
-		$f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out';
265
+		$f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out';
266 266
 	} elseif ($db == '@test@') {
267 267
 		$db = '';
268 268
 	}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	// En cas d'indisponibilite du serveur, eviter de le bombarder
302 302
 	if ($f) {
303 303
 		@touch($f);
304
-		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS);
304
+		spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS);
305 305
 	}
306 306
 	return null;
307 307
 }
@@ -398,11 +398,11 @@  discard block
 block discarded – undo
398 398
 	} elseif (is_array($a)) {
399 399
 		return join(',', array_map('_q', $a));
400 400
 	} elseif (is_scalar($a)) {
401
-		return ("'" . addslashes($a) . "'");
401
+		return ("'".addslashes($a)."'");
402 402
 	} elseif ($a === null) {
403 403
 		return "''";
404 404
 	}
405
-	throw new \RuntimeException('Can’t use _q with ' . gettype($a));
405
+	throw new \RuntimeException('Can’t use _q with '.gettype($a));
406 406
 }
407 407
 
408 408
 /**
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 				$next = reset($textes);
454 454
 				if (
455 455
 					strpos($next, "'") === 0
456
-					and strpos($query_echappees, $part . $next, $currentpos) === $nextpos
456
+					and strpos($query_echappees, $part.$next, $currentpos) === $nextpos
457 457
 				) {
458 458
 					$part .= array_shift($textes);
459 459
 				}
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 			$parts[$k] = [
466 466
 				'texte' => $part,
467 467
 				'position' => $nextpos,
468
-				'placeholder' => '%' . $k . '$s',
468
+				'placeholder' => '%'.$k.'$s',
469 469
 			];
470 470
 			$currentpos = $nextpos + strlen($part);
471 471
 		}
Please login to merge, or discard this patch.