Changeset 96420 in spip-zone
- Timestamp:
- Apr 3, 2016, 6:06:01 PM (5 years ago)
- Location:
- _plugins_/gis_geometries
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/gis_geometries/gisgeom_administrations.php
r90790 r96420 12 12 */ 13 13 function gisgeom_upgrade($nom_meta_base_version,$version_cible){ 14 $current_version = '0.0'; 15 if ( (!isset($GLOBALS['meta'][$nom_meta_base_version]) ) 16 || (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){ 17 // installation 18 if (version_compare($current_version, '0.0','<=')){ 19 include_spip('base/abstract_sql'); 20 // ajout des champs geo et type à la table gis 21 sql_alter("TABLE spip_gis ADD geo GEOMETRY DEFAULT '' NOT NULL AFTER lon"); 22 sql_alter("TABLE spip_gis ADD type VARCHAR (25) DEFAULT '' NOT NULL AFTER zoom"); 23 // renseigner spip_gis.geo avec spip_gis.lat et spip_gis.lon pour les objets existants 24 sql_update("spip_gis", array("geo"=>"GeomFromText(CONCAT('POINT(',lon,' ',lat,')'))")); 25 // renseigner spip_gis.type = point pour les objets existants 26 sql_updateq("spip_gis", array("type"=>"Point")); 27 // ajouter un index sur le champ geo 28 sql_alter("TABLE spip_gis ADD SPATIAL INDEX (geo)"); 29 include_spip('inc/invalideur'); 30 purger_repertoire(_DIR_VAR.'cache-js'); 31 ecrire_meta($nom_meta_base_version,$current_version="1.0.0",'non'); 32 } 33 } 14 $maj = array(); 15 16 $maj['create'] = array( 17 // ajout des champs geo et type à la table gis 18 array('sql_alter', "TABLE spip_gis ADD geo GEOMETRY DEFAULT '' NOT NULL AFTER lon"), 19 array('sql_alter', "TABLE spip_gis ADD type VARCHAR (25) DEFAULT '' NOT NULL AFTER zoom"), 20 // renseigner spip_gis.geo avec spip_gis.lat et spip_gis.lon pour les objets existants 21 array('sql_update', 'spip_gis', array("geo"=>"GeomFromText(CONCAT('POINT(',lon,' ',lat,')'))")), 22 // renseigner spip_gis.type = point pour les objets existants 23 array('sql_updateq', 'spip_gis', array("type"=>"Point")), 24 // ajouter un index sur le champ geo 25 array('sql_alter', 'TABLE spip_gis ADD SPATIAL INDEX (geo)'), 26 // purger le cache js 27 array('gisgeom_purger_cache_js'), 28 ); 29 30 include_spip('base/upgrade'); 31 maj_plugin($nom_meta_base_version, $version_cible, $maj); 32 } 33 34 function gisgeom_purger_cache_js(){ 35 include_spip('inc/invalideur'); 36 purger_repertoire(_DIR_VAR.'cache-js'); 34 37 } 35 38 -
_plugins_/gis_geometries/paquet.xml
r96413 r96420 2 2 prefix="gisgeom" 3 3 categorie="divers" 4 version="1.7. 4"4 version="1.7.5" 5 5 etat="stable" 6 6 compatibilite="[3.0.0;3.1.*]"
Note: See TracChangeset
for help on using the changeset viewer.