Completed
Push — master ( 8b8662...05618b )
by cam
01:05
created
ecrire/maj/legacy/v40.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  * @package SPIP\Core\SQL\Upgrade
21 21
  **/
22 22
 if (!defined('_ECRIRE_INC_VERSION')) {
23
-	return;
23
+    return;
24 24
 }
25 25
 
26 26
 
@@ -35,49 +35,49 @@  discard block
 block discarded – undo
35 35
  **/
36 36
 function maj_timestamp_mysql($tables = null) {
37 37
 
38
-	include_spip('base/dump');
39
-	if (is_null($tables)) {
40
-		$tables = base_lister_toutes_tables();
41
-	} elseif (is_string($tables)) {
42
-		$tables = [$tables];
43
-	} elseif (!is_array($tables)) {
44
-		return;
45
-	}
38
+    include_spip('base/dump');
39
+    if (is_null($tables)) {
40
+        $tables = base_lister_toutes_tables();
41
+    } elseif (is_string($tables)) {
42
+        $tables = [$tables];
43
+    } elseif (!is_array($tables)) {
44
+        return;
45
+    }
46 46
 
47
-	// rien a faire si base non mysql
48
-	if (strncmp($GLOBALS['connexions'][0]['type'], 'mysql', 5) !== 0) {
49
-		return;
50
-	}
47
+    // rien a faire si base non mysql
48
+    if (strncmp($GLOBALS['connexions'][0]['type'], 'mysql', 5) !== 0) {
49
+        return;
50
+    }
51 51
 
52
-	$trouver_table = charger_fonction('trouver_table', 'base');
53
-	// forcer le vidage de cache
54
-	$trouver_table('');
52
+    $trouver_table = charger_fonction('trouver_table', 'base');
53
+    // forcer le vidage de cache
54
+    $trouver_table('');
55 55
 
56
-	foreach ($tables as $table) {
57
-		if (time() >= _TIME_OUT) {
58
-			return;
59
-		}
60
-		if ($desc = $trouver_table($table)) {
61
-			$fields_corrected = _mysql_remplacements_definitions_table($desc['field']);
62
-			$d = array_diff($desc['field'], $fields_corrected);
63
-			if ($d) {
64
-				spip_log("Table $table TIMESTAMP incorrect", 'maj');
65
-				foreach ($desc['field'] as $field => $type) {
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]);
69
-						$trouver_table('');
70
-						$new_desc = $trouver_table($table);
71
-						spip_log(
72
-							"Apres conversion $table : " . var_export($new_desc['field'], true),
73
-							'maj.' . _LOG_INFO_IMPORTANTE
74
-						);
75
-					}
76
-				}
77
-			}
78
-		}
79
-	}
56
+    foreach ($tables as $table) {
57
+        if (time() >= _TIME_OUT) {
58
+            return;
59
+        }
60
+        if ($desc = $trouver_table($table)) {
61
+            $fields_corrected = _mysql_remplacements_definitions_table($desc['field']);
62
+            $d = array_diff($desc['field'], $fields_corrected);
63
+            if ($d) {
64
+                spip_log("Table $table TIMESTAMP incorrect", 'maj');
65
+                foreach ($desc['field'] as $field => $type) {
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]);
69
+                        $trouver_table('');
70
+                        $new_desc = $trouver_table($table);
71
+                        spip_log(
72
+                            "Apres conversion $table : " . var_export($new_desc['field'], true),
73
+                            'maj.' . _LOG_INFO_IMPORTANTE
74
+                        );
75
+                    }
76
+                }
77
+            }
78
+        }
79
+    }
80 80
 
81
-	// forcer le vidage de cache
82
-	$trouver_table('');
81
+    // forcer le vidage de cache
82
+    $trouver_table('');
83 83
 }
Please login to merge, or discard this patch.
ecrire/maj/legacy/svn10000.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
  */
19 19
 
20 20
 if (!defined('_ECRIRE_INC_VERSION')) {
21
-	return;
21
+    return;
22 22
 }
23 23
 
24 24
 include_spip('maj/legacy/v30');
Please login to merge, or discard this patch.
ecrire/base/create.php 1 patch
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Installation
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 include_spip('inc/acces');
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
  * @return bool
34 34
  */
35 35
 function base_determine_autoinc($table, $desc = []) {
36
-	if ($t = lister_tables_principales() and isset($t[$table])) {
37
-		$autoinc = true;
38
-	} elseif ($t = lister_tables_auxiliaires() and isset($t[$table])) {
39
-		$autoinc = false;
40
-	} else {
41
-		// essayer de faire au mieux !
42
-		$autoinc = (isset($desc['key']['PRIMARY KEY'])
43
-			and strpos($desc['key']['PRIMARY KEY'], ',') === false
44
-			and strpos($desc['field'][$desc['key']['PRIMARY KEY']], 'default') === false);
45
-	}
36
+    if ($t = lister_tables_principales() and isset($t[$table])) {
37
+        $autoinc = true;
38
+    } elseif ($t = lister_tables_auxiliaires() and isset($t[$table])) {
39
+        $autoinc = false;
40
+    } else {
41
+        // essayer de faire au mieux !
42
+        $autoinc = (isset($desc['key']['PRIMARY KEY'])
43
+            and strpos($desc['key']['PRIMARY KEY'], ',') === false
44
+            and strpos($desc['field'][$desc['key']['PRIMARY KEY']], 'default') === false);
45
+    }
46 46
 
47
-	return $autoinc;
47
+    return $autoinc;
48 48
 }
49 49
 
50 50
 /**
@@ -61,58 +61,58 @@  discard block
 block discarded – undo
61 61
  * @return void
62 62
  */
63 63
 function creer_ou_upgrader_table($table, $desc, $autoinc, $upgrade = false, $serveur = '') {
64
-	#spip_log("creer_ou_upgrader_table table=$table autoinc=$autoinc upgrade=$upgrade","dbinstall"._LOG_INFO_IMPORTANTE);
65
-	$sql_desc = $upgrade ? sql_showtable($table, true, $serveur) : false;
66
-	#if (!$sql_desc) $sql_desc = false;
67
-	#spip_log("table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE);
68
-	if (!$sql_desc) {
69
-		if ($autoinc === 'auto') {
70
-			$autoinc = base_determine_autoinc($table, $desc);
71
-		}
72
-		#spip_log("sql_create $table autoinc=$autoinc","dbinstall"._LOG_INFO_IMPORTANTE);
73
-		if (isset($desc['field']) and isset($desc['key'])) {
74
-			sql_create($table, $desc['field'], $desc['key'], $autoinc, false, $serveur);
75
-		}
76
-		// verifier la bonne installation de la table (php-fpm es-tu la ?)
77
-		$sql_desc = sql_showtable($table, true, $serveur);
78
-		#if (!$sql_desc) $sql_desc = false;
79
-		#spip_log("Resultat table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE);
80
-		if (!$sql_desc) {
81
-			// on retente avec un sleep ?
82
-			sleep(1);
83
-			sql_create($table, $desc['field'], $desc['key'], $autoinc, false, $serveur);
84
-			$sql_desc = sql_showtable($table, true, $serveur);
85
-			#if (!$sql_desc) $sql_desc = false;
86
-			#spip_log("Resultat table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE);
87
-			if (!$sql_desc) {
88
-				spip_log("Echec creation table $table", 'maj' . _LOG_CRITIQUE);
89
-			}
90
-		}
91
-	} else {
92
-		#spip_log("sql_alter $table ... (on s'en fiche)","dbinstall"._LOG_INFO_IMPORTANTE);
93
-		// ajouter les champs manquants
94
-		// on ne supprime jamais les champs, car c'est dangereux
95
-		// c'est toujours a faire manuellement
96
-		$last = '';
97
-		if (isset($desc['field'])) {
98
-			foreach ($desc['field'] as $field => $type) {
99
-				if (!isset($sql_desc['field'][$field])) {
100
-					sql_alter("TABLE $table ADD $field $type" . ($last ? " AFTER $last" : ''), $serveur);
101
-				}
102
-				$last = $field;
103
-			}
104
-		}
105
-		if (isset($desc['key'])) {
106
-			foreach ($desc['key'] as $key => $type) {
107
-				// Ne pas oublier les cas des cles non nommees dans la declaration et qui sont retournees
108
-				// par le showtable sous la forme d'un index de tableau "KEY $type" et non "KEY"
109
-				if (!isset($sql_desc['key'][$key]) and !isset($sql_desc['key']["$key $type"])) {
110
-					sql_alter("TABLE $table ADD $key ($type)", $serveur);
111
-				}
112
-				$last = $field;
113
-			}
114
-		}
115
-	}
64
+    #spip_log("creer_ou_upgrader_table table=$table autoinc=$autoinc upgrade=$upgrade","dbinstall"._LOG_INFO_IMPORTANTE);
65
+    $sql_desc = $upgrade ? sql_showtable($table, true, $serveur) : false;
66
+    #if (!$sql_desc) $sql_desc = false;
67
+    #spip_log("table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE);
68
+    if (!$sql_desc) {
69
+        if ($autoinc === 'auto') {
70
+            $autoinc = base_determine_autoinc($table, $desc);
71
+        }
72
+        #spip_log("sql_create $table autoinc=$autoinc","dbinstall"._LOG_INFO_IMPORTANTE);
73
+        if (isset($desc['field']) and isset($desc['key'])) {
74
+            sql_create($table, $desc['field'], $desc['key'], $autoinc, false, $serveur);
75
+        }
76
+        // verifier la bonne installation de la table (php-fpm es-tu la ?)
77
+        $sql_desc = sql_showtable($table, true, $serveur);
78
+        #if (!$sql_desc) $sql_desc = false;
79
+        #spip_log("Resultat table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE);
80
+        if (!$sql_desc) {
81
+            // on retente avec un sleep ?
82
+            sleep(1);
83
+            sql_create($table, $desc['field'], $desc['key'], $autoinc, false, $serveur);
84
+            $sql_desc = sql_showtable($table, true, $serveur);
85
+            #if (!$sql_desc) $sql_desc = false;
86
+            #spip_log("Resultat table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE);
87
+            if (!$sql_desc) {
88
+                spip_log("Echec creation table $table", 'maj' . _LOG_CRITIQUE);
89
+            }
90
+        }
91
+    } else {
92
+        #spip_log("sql_alter $table ... (on s'en fiche)","dbinstall"._LOG_INFO_IMPORTANTE);
93
+        // ajouter les champs manquants
94
+        // on ne supprime jamais les champs, car c'est dangereux
95
+        // c'est toujours a faire manuellement
96
+        $last = '';
97
+        if (isset($desc['field'])) {
98
+            foreach ($desc['field'] as $field => $type) {
99
+                if (!isset($sql_desc['field'][$field])) {
100
+                    sql_alter("TABLE $table ADD $field $type" . ($last ? " AFTER $last" : ''), $serveur);
101
+                }
102
+                $last = $field;
103
+            }
104
+        }
105
+        if (isset($desc['key'])) {
106
+            foreach ($desc['key'] as $key => $type) {
107
+                // Ne pas oublier les cas des cles non nommees dans la declaration et qui sont retournees
108
+                // par le showtable sous la forme d'un index de tableau "KEY $type" et non "KEY"
109
+                if (!isset($sql_desc['key'][$key]) and !isset($sql_desc['key']["$key $type"])) {
110
+                    sql_alter("TABLE $table ADD $key ($type)", $serveur);
111
+                }
112
+                $last = $field;
113
+            }
114
+        }
115
+    }
116 116
 }
117 117
 
118 118
 /**
@@ -134,26 +134,26 @@  discard block
 block discarded – undo
134 134
  * @return void
135 135
  */
136 136
 function alterer_base($tables_inc, $tables_noinc, $up = false, $serveur = '') {
137
-	if ($up === false) {
138
-		$old = false;
139
-		$up = [];
140
-	} else {
141
-		$old = true;
142
-		if (!is_array($up)) {
143
-			$up = [$up];
144
-		}
145
-	}
146
-	foreach ($tables_inc as $k => $v) {
147
-		if (!$old or in_array($k, $up)) {
148
-			creer_ou_upgrader_table($k, $v, true, $old, $serveur);
149
-		}
150
-	}
137
+    if ($up === false) {
138
+        $old = false;
139
+        $up = [];
140
+    } else {
141
+        $old = true;
142
+        if (!is_array($up)) {
143
+            $up = [$up];
144
+        }
145
+    }
146
+    foreach ($tables_inc as $k => $v) {
147
+        if (!$old or in_array($k, $up)) {
148
+            creer_ou_upgrader_table($k, $v, true, $old, $serveur);
149
+        }
150
+    }
151 151
 
152
-	foreach ($tables_noinc as $k => $v) {
153
-		if (!$old or in_array($k, $up)) {
154
-			creer_ou_upgrader_table($k, $v, false, $old, $serveur);
155
-		}
156
-	}
152
+    foreach ($tables_noinc as $k => $v) {
153
+        if (!$old or in_array($k, $up)) {
154
+            creer_ou_upgrader_table($k, $v, false, $old, $serveur);
155
+        }
156
+    }
157 157
 }
158 158
 
159 159
 /**
@@ -173,16 +173,16 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function creer_base($serveur = '') {
175 175
 
176
-	// Note: les mises a jour reexecutent ce code pour s'assurer
177
-	// de la conformite de la base
178
-	// pas de panique sur  "already exists" et "duplicate entry" donc.
176
+    // Note: les mises a jour reexecutent ce code pour s'assurer
177
+    // de la conformite de la base
178
+    // pas de panique sur  "already exists" et "duplicate entry" donc.
179 179
 
180
-	alterer_base(
181
-		lister_tables_principales(),
182
-		lister_tables_auxiliaires(),
183
-		false,
184
-		$serveur
185
-	);
180
+    alterer_base(
181
+        lister_tables_principales(),
182
+        lister_tables_auxiliaires(),
183
+        false,
184
+        $serveur
185
+    );
186 186
 }
187 187
 
188 188
 /**
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
  * @return void
203 203
  */
204 204
 function maj_tables($upgrade_tables = [], $serveur = '') {
205
-	alterer_base(
206
-		lister_tables_principales(),
207
-		lister_tables_auxiliaires(),
208
-		$upgrade_tables,
209
-		$serveur
210
-	);
205
+    alterer_base(
206
+        lister_tables_principales(),
207
+        lister_tables_auxiliaires(),
208
+        $upgrade_tables,
209
+        $serveur
210
+    );
211 211
 }
Please login to merge, or discard this patch.
ecrire/base/repair.php 1 patch
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
  **/
37 37
 function base_repair_dist($titre = '', $reprise = '') {
38 38
 
39
-	$res = admin_repair_tables();
40
-	if (!$res) {
41
-		$res = "<div class='error'>" . _T('avis_erreur_mysql') . ' ' . sql_errno() . ': ' . sql_error() . "</div>\n";
42
-	} else {
43
-		include_spip('inc/rubriques');
44
-		calculer_rubriques();
45
-		propager_les_secteurs();
46
-	}
47
-	include_spip('inc/minipres');
48
-	$res .= pipeline('base_admin_repair', $res);
49
-	echo minipres(
50
-		_T('texte_tentative_recuperation'),
51
-		$res . generer_form_ecrire('accueil', '', '', _T('public:accueil_site'))
52
-	);
39
+    $res = admin_repair_tables();
40
+    if (!$res) {
41
+        $res = "<div class='error'>" . _T('avis_erreur_mysql') . ' ' . sql_errno() . ': ' . sql_error() . "</div>\n";
42
+    } else {
43
+        include_spip('inc/rubriques');
44
+        calculer_rubriques();
45
+        propager_les_secteurs();
46
+    }
47
+    include_spip('inc/minipres');
48
+    $res .= pipeline('base_admin_repair', $res);
49
+    echo minipres(
50
+        _T('texte_tentative_recuperation'),
51
+        $res . generer_form_ecrire('accueil', '', '', _T('public:accueil_site'))
52
+    );
53 53
 }
54 54
 
55 55
 /**
@@ -63,59 +63,59 @@  discard block
 block discarded – undo
63 63
  **/
64 64
 function admin_repair_tables() {
65 65
 
66
-	$repair = sql_repair('repair', null, 'continue');
66
+    $repair = sql_repair('repair', null, 'continue');
67 67
 
68
-	// recreer les tables manquantes eventuelles
69
-	include_spip('base/create');
70
-	creer_base();
71
-	$tables = sql_alltable();
68
+    // recreer les tables manquantes eventuelles
69
+    include_spip('base/create');
70
+    creer_base();
71
+    $tables = sql_alltable();
72 72
 
73
-	$res = '';
74
-	foreach ($tables as $tab) {
75
-		$class = '';
76
-		$m = "<strong>$tab</strong> ";
77
-		spip_log("Repare $tab", _LOG_INFO_IMPORTANTE);
78
-		// supprimer la meta avant de lancer la reparation
79
-		// car le repair peut etre long ; on ne veut pas boucler
80
-		effacer_meta('admin_repair');
81
-		if ($repair) {
82
-			$result_repair = sql_repair($tab);
83
-			if (!$result_repair) {
84
-				return false;
85
-			}
86
-		}
73
+    $res = '';
74
+    foreach ($tables as $tab) {
75
+        $class = '';
76
+        $m = "<strong>$tab</strong> ";
77
+        spip_log("Repare $tab", _LOG_INFO_IMPORTANTE);
78
+        // supprimer la meta avant de lancer la reparation
79
+        // car le repair peut etre long ; on ne veut pas boucler
80
+        effacer_meta('admin_repair');
81
+        if ($repair) {
82
+            $result_repair = sql_repair($tab);
83
+            if (!$result_repair) {
84
+                return false;
85
+            }
86
+        }
87 87
 
88
-		// essayer de maj la table (creation de champs manquants)
89
-		maj_tables($tab);
88
+        // essayer de maj la table (creation de champs manquants)
89
+        maj_tables($tab);
90 90
 
91
-		$count = sql_countsel($tab);
91
+        $count = sql_countsel($tab);
92 92
 
93
-		if ($count > 1) {
94
-			$m .= '(' . _T('texte_compte_elements', ['count' => $count]) . ")\n";
95
-		} else {
96
-			if ($count == 1) {
97
-				$m .= '(' . _T('texte_compte_element', ['count' => $count]) . ")\n";
98
-			} else {
99
-				$m .= '(' . _T('texte_vide') . ")\n";
100
-			}
101
-		}
93
+        if ($count > 1) {
94
+            $m .= '(' . _T('texte_compte_elements', ['count' => $count]) . ")\n";
95
+        } else {
96
+            if ($count == 1) {
97
+                $m .= '(' . _T('texte_compte_element', ['count' => $count]) . ")\n";
98
+            } else {
99
+                $m .= '(' . _T('texte_vide') . ")\n";
100
+            }
101
+        }
102 102
 
103
-		if (
104
-			$result_repair
105
-			and $msg = join(
106
-				' ',
107
-				(is_resource($result_repair) or is_object($result_repair)) ? sql_fetch($result_repair) : $result_repair
108
-			) . ' '
109
-			and strpos($msg, ' OK ') === false
110
-		) {
111
-			$class = " class='notice'";
112
-			$m .= '<br /><tt>' . spip_htmlentities($msg) . "</tt>\n";
113
-		} else {
114
-			$m .= ' ' . _T('texte_table_ok');
115
-		}
103
+        if (
104
+            $result_repair
105
+            and $msg = join(
106
+                ' ',
107
+                (is_resource($result_repair) or is_object($result_repair)) ? sql_fetch($result_repair) : $result_repair
108
+            ) . ' '
109
+            and strpos($msg, ' OK ') === false
110
+        ) {
111
+            $class = " class='notice'";
112
+            $m .= '<br /><tt>' . spip_htmlentities($msg) . "</tt>\n";
113
+        } else {
114
+            $m .= ' ' . _T('texte_table_ok');
115
+        }
116 116
 
117
-		$res .= "<div$class>$m</div>";
118
-	}
117
+        $res .= "<div$class>$m</div>";
118
+    }
119 119
 
120
-	return $res;
120
+    return $res;
121 121
 }
Please login to merge, or discard this patch.
ecrire/xml/interfaces.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 define(
18
-	'_REGEXP_DOCTYPE',
19
-	'/^((?:<\001?[?][^>]*>\s*)*(?:<!--.*?-->\s*)*)*<!DOCTYPE\s+(\w+)\s+(\w+)\s*([^>]*)>\s*/s'
18
+    '_REGEXP_DOCTYPE',
19
+    '/^((?:<\001?[?][^>]*>\s*)*(?:<!--.*?-->\s*)*)*<!DOCTYPE\s+(\w+)\s+(\w+)\s*([^>]*)>\s*/s'
20 20
 );
21 21
 
22 22
 define('_REGEXP_XML', '/^(\s*(?:<[?][^x>][^>]*>\s*)?(?:<[?]xml[^>]*>)?\s*(?:<!--.*?-->\s*)*)<(\w+)/s');
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 define('_REGEXP_ENTITY_DEF', '/^%(' . _SUB_REGEXP_SYMBOL . '+);/');
36 36
 define('_REGEXP_TYPE_XML', 'PUBLIC|SYSTEM|INCLUDE|IGNORE|CDATA');
37 37
 define('_REGEXP_ENTITY_DECL', '/^<!ENTITY\s+(%?)\s*(' .
38
-	_SUB_REGEXP_SYMBOL .
39
-	'+;?)\s+(' .
40
-	_REGEXP_TYPE_XML .
41
-	')?\s*(' .
42
-	"('([^']*)')" .
43
-	'|("([^"]*)")' .
44
-	'|\s*(%' . _SUB_REGEXP_SYMBOL . '+;)\s*' .
45
-	')\s*(--.*?--)?("([^"]*)")?\s*>\s*(.*)$/s');
38
+    _SUB_REGEXP_SYMBOL .
39
+    '+;?)\s+(' .
40
+    _REGEXP_TYPE_XML .
41
+    ')?\s*(' .
42
+    "('([^']*)')" .
43
+    '|("([^"]*)")' .
44
+    '|\s*(%' . _SUB_REGEXP_SYMBOL . '+;)\s*' .
45
+    ')\s*(--.*?--)?("([^"]*)")?\s*>\s*(.*)$/s');
46 46
 
47 47
 define('_REGEXP_INCLUDE_USE', '/^<!\[\s*%\s*([^;]*);\s*\[\s*(.*)$/s');
48 48
 
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
  * Document Type Compilation
53 53
  **/
54 54
 class DTC {
55
-	public $macros = [];
56
-	public $elements = [];
57
-	public $peres = [];
58
-	public $attributs = [];
59
-	public $entites = [];
60
-	public $regles = [];
61
-	public $pcdata = [];
55
+    public $macros = [];
56
+    public $elements = [];
57
+    public $peres = [];
58
+    public $attributs = [];
59
+    public $entites = [];
60
+    public $regles = [];
61
+    public $pcdata = [];
62 62
 }
Please login to merge, or discard this patch.
ecrire/iterateur/php.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 if (!defined('_ECRIRE_INC_VERSION')) {
21
-	return;
21
+    return;
22 22
 }
23 23
 
24 24
 
@@ -36,22 +36,22 @@  discard block
 block discarded – undo
36 36
  *     Description de la boucle complétée des champs
37 37
  */
38 38
 function iterateur_php_dist($b, $iteratorName) {
39
-	$b->iterateur = $iteratorName; # designe la classe d'iterateur
40
-	$b->show = [
41
-		'field' => [
42
-			'cle' => 'STRING',
43
-			'valeur' => 'STRING',
44
-		]
45
-	];
46
-	foreach (get_class_methods($iteratorName) as $method) {
47
-		$b->show['field'][strtolower($method)] = 'METHOD';
48
-	}
49
-
50
-	/*
39
+    $b->iterateur = $iteratorName; # designe la classe d'iterateur
40
+    $b->show = [
41
+        'field' => [
42
+            'cle' => 'STRING',
43
+            'valeur' => 'STRING',
44
+        ]
45
+    ];
46
+    foreach (get_class_methods($iteratorName) as $method) {
47
+        $b->show['field'][strtolower($method)] = 'METHOD';
48
+    }
49
+
50
+    /*
51 51
 	foreach (get_class_vars($iteratorName) as $property) {
52 52
 		$b->show['field'][ strtolower($property) ] = 'PROPERTY';
53 53
 	}
54 54
 	*/
55 55
 
56
-	return $b;
56
+    return $b;
57 57
 }
Please login to merge, or discard this patch.
ecrire/iterateur/pour.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 include_spip('iterateur/data');
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
  *     Description de la boucle complétée des champs
40 40
  */
41 41
 function iterateur_POUR_dist($b) {
42
-	$b->iterateur = 'DATA'; # designe la classe d'iterateur
43
-	$b->show = [
44
-		'field' => [
45
-			'cle' => 'STRING',
46
-			'valeur' => 'STRING',
47
-		]
48
-	];
42
+    $b->iterateur = 'DATA'; # designe la classe d'iterateur
43
+    $b->show = [
44
+        'field' => [
45
+            'cle' => 'STRING',
46
+            'valeur' => 'STRING',
47
+        ]
48
+    ];
49 49
 
50
-	return $b;
50
+    return $b;
51 51
 }
Please login to merge, or discard this patch.
ecrire/iterateur/condition.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 include_spip('iterateur/data');
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
  *     Description de la boucle complétée des champs
36 36
  */
37 37
 function iterateur_CONDITION_dist($b) {
38
-	$b->iterateur = 'CONDITION'; # designe la classe d'iterateur
39
-	$b->show = [
40
-		'field' => []
41
-	];
38
+    $b->iterateur = 'CONDITION'; # designe la classe d'iterateur
39
+    $b->show = [
40
+        'field' => []
41
+    ];
42 42
 
43
-	return $b;
43
+    return $b;
44 44
 }
45 45
 
46 46
 /**
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
  * La boucle condition n'a toujours qu'un seul élément.
50 50
  */
51 51
 class IterateurCONDITION extends IterateurData {
52
-	/**
53
-	 * Obtenir les données de la boucle CONDITION
54
-	 *
55
-	 * @param array $command
56
-	 **/
57
-	protected function select($command) {
58
-		$this->tableau = [0 => 1];
59
-	}
52
+    /**
53
+     * Obtenir les données de la boucle CONDITION
54
+     *
55
+     * @param array $command
56
+     **/
57
+    protected function select($command) {
58
+        $this->tableau = [0 => 1];
59
+    }
60 60
 }
Please login to merge, or discard this patch.
ecrire/genie/maintenance.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function genie_maintenance_dist($t) {
37 37
 
38
-	// (re)mettre .htaccess avec deny from all
39
-	// dans les deux repertoires dits inaccessibles par http
40
-	include_spip('inc/acces');
41
-	verifier_htaccess(_DIR_ETC);
42
-	verifier_htaccess(_DIR_TMP);
38
+    // (re)mettre .htaccess avec deny from all
39
+    // dans les deux repertoires dits inaccessibles par http
40
+    include_spip('inc/acces');
41
+    verifier_htaccess(_DIR_ETC);
42
+    verifier_htaccess(_DIR_TMP);
43 43
 
44
-	// Verifier qu'aucune table n'est crashee
45
-	if (!_request('reinstall')) {
46
-		verifier_crash_tables();
47
-	}
44
+    // Verifier qu'aucune table n'est crashee
45
+    if (!_request('reinstall')) {
46
+        verifier_crash_tables();
47
+    }
48 48
 
49
-	return 1;
49
+    return 1;
50 50
 }
51 51
 
52 52
 
@@ -63,33 +63,33 @@  discard block
 block discarded – undo
63 63
  *     des tables qui ont crashé.
64 64
  */
65 65
 function verifier_crash_tables() {
66
-	if (spip_connect()) {
67
-		include_spip('base/serial');
68
-		include_spip('base/auxiliaires');
69
-		$crash = [];
70
-		foreach (['tables_principales', 'tables_auxiliaires'] as $com) {
71
-			foreach ($GLOBALS[$com] as $table => $desc) {
72
-				if (
73
-					!sql_select('*', $table, '', '', '', 1)
74
-					and !defined('spip_interdire_cache')
75
-				) { # cas "LOST CONNECTION"
76
-				$crash[] = $table;
77
-				}
78
-			}
79
-		}
80
-		#$crash[] = 'test';
81
-		if ($crash) {
82
-			ecrire_meta('message_crash_tables', serialize($crash));
83
-			spip_log('crash des tables', 'err');
84
-			spip_log($crash, 'err');
85
-		} else {
86
-			effacer_meta('message_crash_tables');
87
-		}
66
+    if (spip_connect()) {
67
+        include_spip('base/serial');
68
+        include_spip('base/auxiliaires');
69
+        $crash = [];
70
+        foreach (['tables_principales', 'tables_auxiliaires'] as $com) {
71
+            foreach ($GLOBALS[$com] as $table => $desc) {
72
+                if (
73
+                    !sql_select('*', $table, '', '', '', 1)
74
+                    and !defined('spip_interdire_cache')
75
+                ) { # cas "LOST CONNECTION"
76
+                $crash[] = $table;
77
+                }
78
+            }
79
+        }
80
+        #$crash[] = 'test';
81
+        if ($crash) {
82
+            ecrire_meta('message_crash_tables', serialize($crash));
83
+            spip_log('crash des tables', 'err');
84
+            spip_log($crash, 'err');
85
+        } else {
86
+            effacer_meta('message_crash_tables');
87
+        }
88 88
 
89
-		return $crash;
90
-	}
89
+        return $crash;
90
+    }
91 91
 
92
-	return false;
92
+    return false;
93 93
 }
94 94
 
95 95
 /**
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
  * @return string
106 106
  */
107 107
 function message_crash_tables() {
108
-	if ($crash = verifier_crash_tables()) {
109
-		return
110
-			'<strong>' . _T('texte_recuperer_base') . '</strong><br />'
111
-			. ' <tt>' . join(', ', $crash) . '</tt><br />'
112
-			. generer_form_ecrire(
113
-				'base_repair',
114
-				_T('texte_crash_base'),
115
-				'',
116
-				_T('bouton_tenter_recuperation')
117
-			);
118
-	}
108
+    if ($crash = verifier_crash_tables()) {
109
+        return
110
+            '<strong>' . _T('texte_recuperer_base') . '</strong><br />'
111
+            . ' <tt>' . join(', ', $crash) . '</tt><br />'
112
+            . generer_form_ecrire(
113
+                'base_repair',
114
+                _T('texte_crash_base'),
115
+                '',
116
+                _T('bouton_tenter_recuperation')
117
+            );
118
+    }
119 119
 }
Please login to merge, or discard this patch.