[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / ecrire / maj / v016.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2017 *
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 /**
14 * Gestion des mises à jour de SPIP, versions 1.6*
15 *
16 * @package SPIP\Core\SQL\Upgrade
17 **/
18 if (!defined('_ECRIRE_INC_VERSION')) {
19 return;
20 }
21
22 /**
23 * Mises à jour de SPIP n°016
24 *
25 * @param float $version_installee Version actuelle
26 * @param float $version_cible Version de destination
27 **/
28 function maj_v016_dist($version_installee, $version_cible) {
29
30 if (upgrade_vers(1.600, $version_installee, $version_cible)) {
31 #8/08/07 plus d'indexation dans le core
32 # include_spip('inc/indexation');
33 # purger_index();
34 # creer_liste_indexation();
35 maj_version(1.600);
36 }
37
38 if (upgrade_vers(1.601, $version_installee, $version_cible)) {
39 spip_query("ALTER TABLE spip_forum ADD INDEX id_syndic (id_syndic)");
40 maj_version(1.601);
41 }
42
43 if (upgrade_vers(1.603, $version_installee, $version_cible)) {
44 // supprimer les fichiers deplaces
45 spip_unlink('inc_meta_cache.php');
46 spip_unlink('inc_meta_cache.php3');
47 spip_unlink('data/engines-list.ini');
48 maj_version(1.603);
49 }
50
51 if (upgrade_vers(1.604, $version_installee, $version_cible)) {
52 spip_query("ALTER TABLE spip_auteurs ADD lang VARCHAR(10) DEFAULT '' NOT NULL");
53 $u = spip_query("SELECT * FROM spip_auteurs WHERE prefs LIKE '%spip_lang%'");
54 while ($row = sql_fetch($u)) {
55 $prefs = unserialize($row['prefs']);
56 $l = $prefs['spip_lang'];
57 unset($prefs['spip_lang']);
58 spip_query("UPDATE spip_auteurs SET lang=" . _q($l) . ", prefs='" . addslashes(serialize($prefs)) . "' WHERE id_auteur=" . $row['id_auteur']);
59 }
60 $u = spip_query("SELECT lang FROM spip_auteurs");
61 maj_version(1.604, $u);
62 }
63 }