X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fmaj%2Fv019_pre193.php;fp=www%2Fecrire%2Fmaj%2Fv019_pre193.php;h=caee032a779be46f2efdb7f517fba0419d4a8461;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c diff --git a/www/ecrire/maj/v019_pre193.php b/www/ecrire/maj/v019_pre193.php new file mode 100644 index 0000000..caee032 --- /dev/null +++ b/www/ecrire/maj/v019_pre193.php @@ -0,0 +1,302 @@ +id_table + $liste_tables = array(); + $liste_tables[1]='spip_articles'; + $liste_tables[2]='spip_auteurs'; + $liste_tables[3]='spip_breves'; + $liste_tables[4]='spip_documents'; + $liste_tables[5]='spip_forum'; + $liste_tables[6]='spip_mots'; + $liste_tables[7]='spip_rubriques'; + $liste_tables[8]='spip_signatures'; + $liste_tables[9]='spip_syndic'; + + ecrire_meta('index_table', serialize($liste_tables)); + +## devenu inutile car suppression totale de l'indexation +/* + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_article` as id_objet,'1' as id_table FROM spip_index_articles"); + spip_query("DROP TABLE IF EXISTS spip_index_articles"); + + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_auteur` as id_objet,'2' as id_table FROM spip_index_auteurs"); + spip_query("DROP TABLE IF EXISTS spip_index_auteurs"); + + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_breve` as id_objet,'3' as id_table FROM spip_index_breves"); + spip_query("DROP TABLE IF EXISTS spip_index_breves"); + + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_document` as id_objet,'4' as id_table FROM spip_index_documents"); + spip_query("DROP TABLE IF EXISTS spip_index_documents"); + + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_forum` as id_objet,'5' as id_table FROM spip_index_forum"); + spip_query("DROP TABLE IF EXISTS spip_index_forum"); + + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_mot` as id_objet,'6' as id_table FROM spip_index_mots"); + spip_query("DROP TABLE IF EXISTS spip_index_mots"); + + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_rubrique` as id_objet,'7' as id_table FROM spip_index_rubriques"); + spip_query("DROP TABLE IF EXISTS spip_index_rubriques"); + + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_signature` as id_objet,'8' as id_table FROM spip_index_signatures"); + spip_query("DROP TABLE IF EXISTS spip_index_signatures"); + + spip_query("INSERT INTO spip_index (`hash`,`points`,`id_objet`,`id_table`) SELECT `hash`,`points`,`id_syndic` as id_objet,'9' as `id_table FROM spip_index_syndic"); + spip_query("DROP TABLE IF EXISTS spip_index_syndic"); +*/ + maj_version(1.905); + } + + + // cette table est desormais geree par le plugin "podcast_client", on la + // supprime si le plugin n'est pas active ; risque inherent a l'utilisation + // de versions alpha :-) + if (upgrade_vers(1.906, $version_installee, $version_cible)) { + if (!@in_array('podcast_client', $GLOBALS['plugins'])) { + spip_query("DROP TABLE spip_documents_syndic"); + } + maj_version(1.906); + } + if (upgrade_vers(1.907, $version_installee, $version_cible)) { + spip_query("ALTER TABLE spip_forum ADD INDEX `idx` (`idx`)"); + maj_version(1.907); + } + // Oups ! on stockait les tags de syndication sous la forme rel="category" + // au lieu de rel="directory" - http://microformats.org/wiki/rel-directory + if (upgrade_vers(1.908, $version_installee, $version_cible)) { + spip_query("UPDATE spip_syndic_articles SET `tags` = REPLACE(`tags`, 'rel=\"category\">', 'rel=\"directory\">') WHERE `tags` like '%category%'"); + maj_version(1.908); + } + if (upgrade_vers(1.909, $version_installee, $version_cible)) { + spip_query("ALTER IGNORE TABLE spip_mots_articles ADD PRIMARY KEY (`id_article`, `id_mot`)"); + spip_query("ALTER IGNORE TABLE spip_mots_breves ADD PRIMARY KEY (`id_breve`, `id_mot`)"); + spip_query("ALTER IGNORE TABLE spip_mots_rubriques ADD PRIMARY KEY (`id_rubrique`, `id_mot`)"); + spip_query("ALTER IGNORE TABLE spip_mots_syndic ADD PRIMARY KEY (`id_syndic`, `id_mot`)"); + spip_query("ALTER IGNORE TABLE spip_mots_documents ADD PRIMARY KEY (`id_document`, `id_mot`)"); + spip_query("ALTER IGNORE TABLE spip_mots_forum ADD PRIMARY KEY (`id_forum`, `id_mot`)"); + maj_version(1.909); + } + + if (upgrade_vers(1.910, $version_installee, $version_cible)) { + spip_query("ALTER IGNORE TABLE spip_auteurs_articles ADD PRIMARY KEY (`id_auteur`, `id_article`)"); + spip_query("ALTER IGNORE TABLE spip_auteurs_rubriques ADD PRIMARY KEY (`id_auteur`, `id_rubrique`)"); + spip_query("ALTER IGNORE TABLE spip_auteurs_messages ADD PRIMARY KEY (`id_auteur`, `id_message`)"); + maj_version(1.910); + } + + if (upgrade_vers(1.911, $version_installee, $version_cible)) { + + spip_query("ALTER IGNORE TABLE spip_auteurs_articles DROP INDEX `id_auteur`"); + spip_query("ALTER IGNORE TABLE spip_auteurs_rubriques DROP INDEX `id_auteur`"); + spip_query("ALTER IGNORE TABLE spip_auteurs_messages DROP INDEX `id_auteur`"); + spip_query("ALTER IGNORE TABLE spip_mots_articles DROP INDEX `id_article`"); + spip_query("ALTER IGNORE TABLE spip_mots_breves DROP INDEX `id_breve`"); + spip_query("ALTER IGNORE TABLE spip_mots_rubriques DROP INDEX `id_rubrique`"); + spip_query("ALTER IGNORE TABLE spip_mots_syndic DROP INDEX `id_syndic`"); + spip_query("ALTER IGNORE TABLE spip_mots_forum DROP INDEX `id_forum`"); + spip_query("ALTER IGNORE TABLE spip_mots_documents DROP INDEX `id_document`"); +# 18 juillet 2007: table depreciee +# spip_query("ALTER IGNORE TABLE spip_caches DROP INDEX fichier"); + maj_version(1.911); + } + + // Le logo du site n'est plus le logo par defaut des rubriques + // mais pour assurer la compatibilite ascendante, on le duplique + if (upgrade_vers(1.912, $version_installee, $version_cible)) { + @copy(_DIR_LOGOS.'rubon0.gif', _DIR_LOGOS.'siteon0.gif'); + @copy(_DIR_LOGOS.'ruboff0.gif', _DIR_LOGOS.'siteoff0.gif'); + @copy(_DIR_LOGOS.'rubon0.jpg', _DIR_LOGOS.'siteon0.jpg'); + @copy(_DIR_LOGOS.'ruboff0.jpg', _DIR_LOGOS.'siteoff0.jpg'); + @copy(_DIR_LOGOS.'rubon0.png', _DIR_LOGOS.'siteon0.png'); + @copy(_DIR_LOGOS.'ruboff0.png', _DIR_LOGOS.'siteoff0.png'); + maj_version(1.912); + } + + // suppression de auteur_modif qui n'est plus utilise nulle part + if (upgrade_vers(1.913, $version_installee, $version_cible)) { + spip_query("ALTER TABLE spip_articles DROP `auteur_modif`"); + maj_version(1.913); + } + + // Ajout de SVG + if (upgrade_vers(1.914, $version_installee, $version_cible)) { + spip_query("INSERT IGNORE INTO spip_types_documents (`extension`, `titre`, `inclus`) VALUES ('svg', 'Scalable Vector Graphics', 'embed')"); + spip_query("UPDATE spip_types_documents SET `mime_type`='image/svg+xml' WHERE `extension`='svg'"); + maj_version(1.914); + } + + // Ajout de plein de type mime + if (upgrade_vers(1.915, $version_installee, $version_cible)) { + maj_version(1.915); + } + // refaire l'upgrade 1.905 qui a pu foirer en partie a cause de la requete ALTER sur spip_meta + if (upgrade_vers(1.916, $version_installee, $version_cible)) { + // agrandir le champ "valeur" de spip_meta pour pouvoir y stocker + // des choses plus sympa + spip_query("ALTER TABLE spip_meta DROP INDEX `valeur`"); + spip_query("ALTER TABLE spip_meta CHANGE `valeur` `valeur` TEXT"); +#8/08/07 plus d'indexation dans le core + //include_spip('inc/indexation'); + //update_index_tables(); + maj_version(1.916); + } + if (upgrade_vers(1.917, $version_installee, $version_cible)) { + spip_query("ALTER TABLE spip_documents DROP `inclus`"); + maj_version(1.917); + } + + // Permettre d'enregistrer un numero IP dans les revisions d'articles + // a la place de l'id_auteur + if (upgrade_vers(1.918, $version_installee, $version_cible)) { + spip_query("ALTER TABLE spip_versions CHANGE `id_auteur` `id_auteur` VARCHAR(23)"); + maj_version(1.918); + } + + if (upgrade_vers(1.919, $version_installee, $version_cible)) { + spip_query("ALTER TABLE spip_ajax_fonc DROP `id_auteur`"); + maj_version('1.919'); + } + + if (upgrade_vers(1.920, $version_installee, $version_cible)) { + spip_query("ALTER IGNORE TABLE spip_documents_articles ADD PRIMARY KEY (`id_article`, `id_document`)"); + spip_query("ALTER IGNORE TABLE spip_documents_breves ADD PRIMARY KEY (`id_breve`, `id_document`)"); + spip_query("ALTER IGNORE TABLE spip_documents_rubriques ADD PRIMARY KEY (`id_rubrique`, `id_document`)"); + spip_query("ALTER IGNORE TABLE spip_documents_articles DROP INDEX `id_article`"); + spip_query("ALTER IGNORE TABLE spip_documents_breves DROP INDEX `id_breve`"); + spip_query("ALTER IGNORE TABLE spip_documents_rubriques DROP INDEX `id_rubrique`"); + maj_version('1.920'); + } + if (upgrade_vers(1.922, $version_installee, $version_cible)) { + spip_query("ALTER TABLE spip_meta ADD `impt` ENUM('non', 'oui') DEFAULT 'oui' NOT NULL AFTER `valeur`"); + $meta_serveur = array('version_installee','adresse_site','alea_ephemere_ancien','alea_ephemere','alea_ephemere_date','langue_site','langues_proposees','date_calcul_rubriques','derniere_modif','optimiser_table','drapeau_edition','creer_preview','taille_preview','creer_htpasswd','creer_htaccess','gd_formats_read','gd_formats', + 'netpbm_formats','formats_graphiques','image_process','plugin_header','plugin'); + foreach($meta_serveur as $nom) + spip_query("UPDATE spip_meta SET `impt`='non' WHERE `nom`="._q($nom)); + maj_version('1.922'); + } + if (upgrade_vers(1.923, $version_installee, $version_cible)) { + if (isset($GLOBALS['meta']['IMPORT_tables_noimport'])){ + $IMPORT_tables_noimport = unserialize($GLOBALS['meta']['IMPORT_tables_noimport']); + foreach ($IMPORT_tables_noimport as $key=>$table) + if ($table=='spip_meta') unset($IMPORT_tables_noimport[$key]); + ecrire_meta('IMPORT_tables_noimport',serialize($IMPORT_tables_noimport),'non'); + } + maj_version('1.923'); + } + + if (upgrade_vers(1.924, $version_installee, $version_cible)) { + spip_query('DROP TABLE spip_ajax_fonc'); + maj_version('1.924'); + } + + if (upgrade_vers(1.925, $version_installee, $version_cible)) { + include_spip('inc/flock'); + /* deplacement des sessions */ + $f_session = preg_files('data', 'session_'); + $repertoire = _DIR_SESSIONS; + if(!@file_exists($repertoire)) { + $repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire); + $repertoire = sous_repertoire(_DIR_TMP, $repertoire); + } + foreach($f_session as $f) { + $d = basename($f); + @copy($f, $repertoire.$d); + } + /* deplacement des visites */ + $f_visites = preg_files('data/visites'); + $repertoire = sous_repertoire(_DIR_TMP, 'visites'); + foreach($f_visites as $f) { + $d = basename($f); + @copy($f, $repertoire.$d); + } + /* deplacement des upload */ + $auteurs = array(); + $req = spip_query("SELECT `login` FROM spip_auteurs WHERE `statut` = '0minirezo'"); + while($row = sql_fetch($req)) + $auteurs[] = $row['login']; + $f_upload = preg_files('upload', -1, 10000, $auteurs); + $repertoire = _DIR_TRANSFERT; + if(!@file_exists($repertoire)) { + $repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire); + $repertoire = sous_repertoire(_DIR_TMP, $repertoire); + } + foreach($auteurs as $login) { + if(is_dir('upload/'.$login)) + $sous_repertoire = sous_repertoire(_DIR_TRANSFERT, $login); + } + foreach($f_upload as $f) { + @copy($f, _DIR_TMP.$f); + } + /* deplacement des dumps */ + $f_session = preg_files('data', 'dump'); + $repertoire = _DIR_DUMP; + if(!@file_exists($repertoire)) { + $repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire); + $repertoire = sous_repertoire(_DIR_TMP, $repertoire); + } + foreach($f_session as $f) { + $d = basename($f); + @copy($f, $repertoire.$d); + } + maj_version('1.925'); + } + // Ajout de MP4 + if (upgrade_vers(1.926, $version_installee, $version_cible)) { + spip_query("INSERT IGNORE INTO spip_types_documents (`extension`, `titre`, `inclus`) VALUES ('mp4', 'MPEG4', 'embed')"); + spip_query("UPDATE spip_types_documents SET `mime_type`='application/mp4' WHERE `extension`='mp4'"); + maj_version('1.926'); + } +} +?>