Completed
Push — spip-2.1 ( b6b097 )
by cam
42:28 queued 30:44
created

v014.php ➔ maj_v014_dist()   F

Complexity

Conditions 49
Paths > 20000

Size

Total Lines 309
Code Lines 203

Duplication

Lines 92
Ratio 29.77 %

Importance

Changes 0
Metric Value
cc 49
eloc 203
nc 4294967295
nop 2
dl 92
loc 309
rs 2
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/***************************************************************************\
4
 *  SPIP, Systeme de publication pour l'internet                           *
5
 *                                                                         *
6
 *  Copyright (c) 2001-2016                                                *
7
 *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
8
 *                                                                         *
9
 *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
10
 *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
11
\***************************************************************************/
12
13
if (!defined('_ECRIRE_INC_VERSION')) return;
14
15
16
17
function maj_v014_dist($version_installee, $version_cible)
18
{
19 View Code Duplication
	if (upgrade_vers(1.404, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
		spip_query("UPDATE spip_mots SET type='Mots sans groupe...' WHERE type=''");
21
22
		$result = spip_query("SELECT * FROM spip_mots GROUP BY type");
23
		while($row = sql_fetch($result)) {
24
				$type = addslashes($row['type']);
25
				// Old style, doit echouer
26
				spip_log('ne pas tenir compte de l erreur spip_groupes_mots ci-dessous:', 'mysql');
27
				spip_query("INSERT INTO spip_groupes_mots 					(titre, unseul, obligatoire, articles, breves, rubriques, syndic, 0minirezo, 1comite, 6forum)					VALUES (\"$type\", 'non', 'non', 'oui', 'oui', 'non', 'oui', 'oui', 'oui', 'non')");
28
				// New style, devrait marcher
29
				spip_query("INSERT INTO spip_groupes_mots 					(titre, unseul, obligatoire, articles, breves, rubriques, syndic, minirezo, comite, forum)					VALUES (\"$type\", 'non', 'non', 'oui', 'oui', 'non', 'oui', 'oui', 'oui', 'non')");
30
		}
31
		sql_delete("spip_mots", "titre='kawax'");
32
		maj_version (1.404);
33
	}
34
35 View Code Duplication
	if (upgrade_vers(1.405, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
36
		spip_query("ALTER TABLE spip_mots ADD id_groupe bigint(21) NOT NULL");
37
	
38
		$result = spip_query("SELECT * FROM spip_groupes_mots");
39
		while($row = sql_fetch($result)) {
40
				$id_groupe = addslashes($row['id_groupe']);
41
				$type = addslashes($row['titre']);
42
				spip_query("UPDATE spip_mots SET id_groupe = '$id_groupe' WHERE type='$type'");
43
		}
44
		maj_version (1.405);
45
	}
46
47
	if (upgrade_vers(1.408, $version_installee, $version_cible)) {
48
		// Images articles passent dans spip_documents
49
		$result = spip_query("SELECT id_article, images FROM spip_articles WHERE LENGTH(images) > 0");
50
51
52
		$types = array('jpg' => 1, 'png' => 2, 'gif' => 3);
53
54
		while ($row = @sql_fetch($result)) {
55
			$id_article = $row['id_article'];
56
			$images = $row['images'];
57
			$images = explode(",", $images);
58
			reset($images);
59
			$replace = '_orig_';
60
			foreach ($images as $val) {
61
				$image = explode("|", $val);
62
				$fichier = $image[0];
63
				$largeur = $image[1];
64
				$hauteur = $image[2];
65
				preg_match(",-([0-9]+)\.(gif|jpg|png)$,i", $fichier, $match);
66
				$id_type = intval($types[$match[2]]);
67
				$num_img = $match[1];
68
				$fichier = _DIR_IMG . $fichier;
69
				$taille = @filesize($fichier);
70
				// ici on n'a pas les fonctions absctract !
71
				$s = spip_query("INSERT INTO spip_documents (titre, id_type, fichier, mode, largeur, hauteur, taille) VALUES ('image $largeur x $hauteur', $id_type, '$fichier', 'vignette', '$largeur', '$hauteur', '$taille')");
72
				$id_document = mysql_insert_id($s);
73
				if ($id_document > 0) {
74
					spip_query("INSERT INTO spip_documents_articles (id_document, id_article) VALUES ($id_document, $id_article)");
75
					$replace = "REPLACE($replace, '<IMG$num_img|', '<IM_$id_document|')";
76
				} else {
77
					echo _T('texte_erreur_mise_niveau_base', array('fichier' => $fichier, 'id_article' => $id_article));
78
					exit;
0 ignored issues
show
Coding Style Compatibility introduced by
The function maj_v014_dist() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
79
				}
80
			}
81
			$replace = "REPLACE($replace, '<IM_', '<IMG')";
82
			$replace_chapo = str_replace('_orig_', 'chapo', $replace);
83
			$replace_descriptif = str_replace('_orig_', 'descriptif', $replace);
84
			$replace_texte = str_replace('_orig_', 'texte', $replace);
85
			$replace_ps = str_replace('_orig_', 'ps', $replace);
86
			spip_query("UPDATE spip_articles SET chapo=$replace_chapo, descriptif=$replace_descriptif, texte=$replace_texte, ps=$replace_ps WHERE id_article=$id_article");
87
88
		}
89
		spip_query("ALTER TABLE spip_articles DROP images");
90
		maj_version (1.408);
91
	}
92
93
	if (upgrade_vers(1.414, $version_installee, $version_cible)) {
94
		// Forum par defaut "en dur" dans les spip_articles
95
		// -> non, prio (priori), pos (posteriori), abo (abonnement)
96
		$accepter_forum = substr($GLOBALS['meta']["forums_publics"],0,3) ;
97
		$result = spip_query("ALTER TABLE spip_articles CHANGE accepter_forum accepter_forum CHAR(3) NOT NULL");
0 ignored issues
show
Unused Code introduced by
$result is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
98
99
		$result = spip_query("UPDATE spip_articles SET accepter_forum='$accepter_forum' WHERE accepter_forum != 'non'");
0 ignored issues
show
Unused Code introduced by
$result is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
100
101
		maj_version (1.414);
102
	}
103
104
	/*
105
	if ($version_installee == 1.415) {
106
		spip_query("ALTER TABLE spip_documents DROP inclus");
107
		maj_version (1.415);
108
	}
109
	*/
110
111
	if (upgrade_vers(1.417, $version_installee, $version_cible)) {
112
		spip_query("ALTER TABLE spip_syndic_articles DROP date_index");
113
		maj_version (1.417);
114
	}
115
116
	if (upgrade_vers(1.418, $version_installee, $version_cible)) {
117
		$result = spip_query("SELECT * FROM spip_auteurs WHERE statut = '0minirezo' AND email != '' ORDER BY id_auteur LIMIT 1");
118
119
		if ($webmaster = sql_fetch($result)) {
120
			ecrire_meta('email_webmaster', $webmaster['email']);
121
		}
122
		maj_version (1.418);
123
	}
124
125 View Code Duplication
	if (upgrade_vers(1.419, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
126
		spip_query("ALTER TABLE spip_auteurs ADD alea_actuel TINYTEXT DEFAULT ''");
127
		spip_query("ALTER TABLE spip_auteurs ADD alea_futur TINYTEXT DEFAULT ''");
128
		spip_query("UPDATE spip_auteurs SET alea_futur = FLOOR(32000*RAND())");
129
		maj_version (1.419);
130
	}
131
132
	if (upgrade_vers(1.420, $version_installee, $version_cible)) {
133
		spip_query("UPDATE spip_auteurs SET alea_actuel='' WHERE statut='nouveau'");
134
		maj_version (1.420);
135
	}
136
	
137
	if (upgrade_vers(1.421, $version_installee, $version_cible)) {
138
		spip_query("ALTER TABLE spip_articles ADD auteur_modif bigint(21) DEFAULT '0' NOT NULL");
139
		spip_query("ALTER TABLE spip_articles ADD date_modif datetime DEFAULT '0000-00-00 00:00:00' NOT NULL");
140
		maj_version (1.421);
141
	}
142
143 View Code Duplication
	if (upgrade_vers(1.432, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
144
		spip_query("ALTER TABLE spip_articles DROP referers");
145
		spip_query("ALTER TABLE spip_articles ADD referers INTEGER DEFAULT '0' NOT NULL");
146
		spip_query("ALTER TABLE spip_articles ADD popularite INTEGER DEFAULT '0' NOT NULL");
147
		maj_version (1.432);
148
	}
149
150
	if (upgrade_vers(1.436, $version_installee, $version_cible)) {
151
		spip_query("ALTER TABLE spip_documents ADD date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL");
152
		maj_version (1.436);
153
	}
154
155
	if (upgrade_vers(1.437, $version_installee, $version_cible)) {
156
		spip_query("ALTER TABLE spip_visites ADD maj TIMESTAMP");
157
		spip_query("ALTER TABLE spip_visites_referers ADD maj TIMESTAMP");
158
		maj_version (1.437);
159
	}
160
161
	if (upgrade_vers(1.438, $version_installee, $version_cible)) {
162
		spip_query("ALTER TABLE spip_articles ADD INDEX id_secteur (id_secteur)");
163
		spip_query("ALTER TABLE spip_articles ADD INDEX statut (statut, date)");
164
		maj_version (1.438);
165
	}
166
167 View Code Duplication
	if (upgrade_vers(1.439, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
168
		spip_query("ALTER TABLE spip_syndic ADD INDEX statut (statut, date_syndic)");
169
		spip_query("ALTER TABLE spip_syndic_articles ADD INDEX statut (statut)");
170
		spip_query("ALTER TABLE spip_syndic_articles CHANGE url url VARCHAR(255) NOT NULL");
171
		spip_query("ALTER TABLE spip_syndic_articles ADD INDEX url (url)");
172
		maj_version (1.439);
173
	}
174
175
	if (upgrade_vers(1.440, $version_installee, $version_cible)) {
176
		spip_query("ALTER TABLE spip_visites_temp CHANGE ip ip INTEGER UNSIGNED NOT NULL");
177
		maj_version (1.440);
178
	}
179
180 View Code Duplication
	if (upgrade_vers(1.441, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
181
		spip_query("ALTER TABLE spip_visites_temp CHANGE date date DATE NOT NULL");
182
		spip_query("ALTER TABLE spip_visites CHANGE date date DATE NOT NULL");
183
		spip_query("ALTER TABLE spip_visites_referers CHANGE date date DATE NOT NULL");
184
		maj_version (1.441);
185
	}
186
187
	if (upgrade_vers(1.442, $version_installee, $version_cible)) {
188
		spip_query("ALTER TABLE spip_auteurs ADD prefs TINYTEXT NOT NULL");
189
		maj_version (1.442);
190
	}
191
192 View Code Duplication
	if (upgrade_vers(1.443, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
193
		spip_query("ALTER TABLE spip_auteurs CHANGE login login VARCHAR(255) BINARY NOT NULL");
194
		spip_query("ALTER TABLE spip_auteurs CHANGE statut statut VARCHAR(255) NOT NULL");
195
		spip_query("ALTER TABLE spip_auteurs ADD INDEX login (login)");
196
		spip_query("ALTER TABLE spip_auteurs ADD INDEX statut (statut)");
197
		maj_version (1.443);
198
	}
199
200
	if (upgrade_vers(1.444, $version_installee, $version_cible)) {
201
		spip_query("ALTER TABLE spip_syndic ADD moderation VARCHAR(3) NOT NULL");
202
		maj_version (1.444);
203
	}
204
205 View Code Duplication
	if (upgrade_vers(1.457, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
206
		spip_query("DROP TABLE spip_visites");
207
		spip_query("DROP TABLE spip_visites_temp");
208
		spip_query("DROP TABLE spip_visites_referers");
209
		creer_base(); // crade, a ameliorer :-((
210
		maj_version (1.457);
211
	}
212
213
	if (upgrade_vers(1.458, $version_installee, $version_cible)) {
214
		spip_query("ALTER TABLE spip_auteurs ADD cookie_oubli TINYTEXT NOT NULL");
215
		maj_version (1.458);
216
	}
217
218
	if (upgrade_vers(1.459, $version_installee, $version_cible)) {
219
		$result = spip_query("SELECT type FROM spip_mots GROUP BY type");
220
		while ($row = sql_fetch($result)) {
221
			$type = addslashes($row['type']);
222
			$res = spip_query("SELECT * FROM spip_groupes_mots WHERE titre='$type'");
223
			if (sql_count($res) == 0) {
224
				$s = spip_query("INSERT INTO spip_groupes_mots (titre, unseul, obligatoire, articles, breves, rubriques, syndic, minirezo, comite, forum) VALUES ('$type', 'non', 'non', 'oui', 'oui', 'non', 'oui', 'oui', 'oui', 'non')");
225
			  if ($id_groupe = mysql_insert_id($s))
226
					spip_query("UPDATE spip_mots SET id_groupe = '$id_groupe' WHERE type='$type'");
227
			}
228
		}
229
		spip_query("UPDATE spip_articles SET popularite=0");
230
		maj_version (1.459);
231
	}
232
233
	if (upgrade_vers(1.460, $version_installee, $version_cible)) {
234
		// remettre les mots dans les groupes dupliques par erreur
235
		// dans la precedente version du paragraphe de maj 1.459
236
		// et supprimer ceux-ci
237
		$result = spip_query("SELECT * FROM spip_groupes_mots ORDER BY id_groupe");
238
		while ($row = sql_fetch($result)) {
239
			$titre = addslashes($row['titre']);
240
			if (! $vu[$titre] ) {
0 ignored issues
show
Bug introduced by
The variable $vu does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
241
				$vu[$titre] = true;
0 ignored issues
show
Coding Style Comprehensibility introduced by
$vu was never initialized. Although not strictly required by PHP, it is generally a good practice to add $vu = array(); before regardless.

Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code.

Let’s take a look at an example:

foreach ($collection as $item) {
    $myArray['foo'] = $item->getFoo();

    if ($item->hasBar()) {
        $myArray['bar'] = $item->getBar();
    }

    // do something with $myArray
}

As you can see in this example, the array $myArray is initialized the first time when the foreach loop is entered. You can also see that the value of the bar key is only written conditionally; thus, its value might result from a previous iteration.

This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.

Loading history...
242
				$id_groupe = $row['id_groupe'];
243
				spip_query("UPDATE spip_mots SET id_groupe=$id_groupe WHERE type='$titre'");
244
				sql_delete("spip_groupes_mots", "titre='$titre' AND id_groupe<>$id_groupe");
245
			}
246
		}
247
		maj_version (1.460);
248
	}
249
250
	if (upgrade_vers(1.462, $version_installee, $version_cible)) {
251
		spip_query("UPDATE spip_types_documents SET inclus='embed' WHERE inclus!='non' AND extension IN ('aiff', 'asf', 'avi', 'mid', 'mov', 'mp3', 'mpg', 'ogg', 'qt', 'ra', 'ram', 'rm', 'swf', 'wav', 'wmv')");
252
		maj_version (1.462);
253
	}
254
255 View Code Duplication
	if (upgrade_vers(1.463, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
256
		spip_query("ALTER TABLE spip_articles CHANGE popularite popularite DOUBLE");
257
		spip_query("ALTER TABLE spip_visites_temp ADD maj TIMESTAMP");
258
		spip_query("ALTER TABLE spip_referers_temp ADD maj TIMESTAMP");
259
		maj_version (1.463);
260
	}
261
262
	// l'upgrade < 1.462 ci-dessus etait fausse, d'ou correctif
263
	if (upgrade_vers(1.464, $version_installee, $version_cible) AND ($version_installee >= 1.462)) {
264
		$res = spip_query("SELECT id_type, extension FROM spip_types_documents WHERE id_type NOT IN (1,2,3)");
265
		while ($row = sql_fetch($res)) {
266
			$extension = $row['extension'];
267
			$id_type = $row['id_type'];
268
			spip_query("UPDATE spip_documents SET id_type=$id_type	WHERE fichier like '%.$extension'");
269
		}
270
		maj_version (1.464);
271
	}
272
273
	if (upgrade_vers(1.465, $version_installee, $version_cible)) {
274
		spip_query("ALTER TABLE spip_articles CHANGE popularite popularite DOUBLE NOT NULL");
275
		maj_version (1.465);
276
	}
277
278
	if (upgrade_vers(1.466, $version_installee, $version_cible)) {
279
		spip_query("ALTER TABLE spip_auteurs ADD source VARCHAR(10) DEFAULT 'spip' NOT NULL");
280
		maj_version (1.466);
281
	}
282
283
	if (upgrade_vers(1.468, $version_installee, $version_cible)) {
284
		spip_query("ALTER TABLE spip_auteurs ADD INDEX en_ligne (en_ligne)");
285
		spip_query("ALTER TABLE spip_forum ADD INDEX statut (statut, date_heure)");
286
		maj_version (1.468);
287
	}
288
289 View Code Duplication
	if (upgrade_vers(1.470, $version_installee, $version_cible)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
290
		if ($version_installee >= 1.467) {	// annule les "listes de diff"
291
			spip_query("DROP TABLE spip_listes");
292
			spip_query("ALTER TABLE spip_auteurs DROP abonne");
293
			spip_query("ALTER TABLE spip_auteurs DROP abonne_pass");
294
		}
295
		maj_version (1.470);
296
	}
297
298
	if (upgrade_vers(1.471, $version_installee, $version_cible)) {
299 View Code Duplication
		if ($version_installee >= 1.470) {	// annule les "maj"
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
300
			spip_query("ALTER TABLE spip_auteurs_articles DROP maj TIMESTAMP");
301
			spip_query("ALTER TABLE spip_auteurs_rubriques DROP maj TIMESTAMP");
302
			spip_query("ALTER TABLE spip_auteurs_messages DROP maj TIMESTAMP");
303
			spip_query("ALTER TABLE spip_documents_articles DROP maj TIMESTAMP");
304
			spip_query("ALTER TABLE spip_documents_rubriques DROP maj TIMESTAMP");
305
			spip_query("ALTER TABLE spip_documents_breves DROP maj TIMESTAMP");
306
			spip_query("ALTER TABLE spip_mots_articles DROP maj TIMESTAMP");
307
			spip_query("ALTER TABLE spip_mots_breves DROP maj TIMESTAMP");
308
			spip_query("ALTER TABLE spip_mots_rubriques DROP maj TIMESTAMP");
309
			spip_query("ALTER TABLE spip_mots_syndic DROP maj TIMESTAMP");
310
			spip_query("ALTER TABLE spip_mots_forum DROP maj TIMESTAMP");
311
		}
312
		maj_version (1.471);
313
	}
314
315
	if (upgrade_vers(1.472, $version_installee, $version_cible)) {
316
		spip_query("ALTER TABLE spip_referers ADD visites_jour INTEGER UNSIGNED NOT NULL");
317
		maj_version (1.472);
318
	}
319
320
	if (upgrade_vers(1.473, $version_installee, $version_cible)) {
321
		spip_query("UPDATE spip_syndic_articles SET url = REPLACE(url, '&amp;', '&')");
322
		spip_query("UPDATE spip_syndic SET url_site = REPLACE(url_site, '&amp;', '&')");
323
		maj_version (1.473);
324
	}
325
}
326
327
328
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
329