Changeset 7308 for extensions/GMaps/gmaps_install.class.inc.php
- Timestamp:
- Oct 20, 2010, 10:49:29 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GMaps/gmaps_install.class.inc.php
r7177 r7308 41 41 public function install() 42 42 { 43 if(!file_exists(GPCCore::getPiwigoSystemPath().self::KML_DIRECTORY)) 44 { 45 mkdir(GPCCore::getPiwigoSystemPath().self::KML_DIRECTORY, 0755, true); 46 } 47 43 48 $this->initConfig(); 44 49 $this->loadConfig(); … … 62 67 `streetViewControl` char(1) NOT NULL default 'n', 63 68 `style` varchar(512) NOT NULL, 69 `zoomLevelMaxActivated` char(1) NOT NULL default 'n', 64 70 PRIMARY KEY (`id`) 65 71 )", … … 131 137 switch($this->config['installed']) 132 138 { 133 // actually, there no migration possible from previous release 139 case '01.00.00'; 140 $this->updateFrom_010000(); 134 141 default: 135 142 // nothing to do... … … 150 157 } 151 158 159 160 /** 161 * update from release 1.0.0 162 * 163 * - create the /local/plugins/GMaps/kml directory 164 * - move kml files from /plugins/GMaps/kml directory to the new directory 165 * - remove the /plugins/GMaps/kml directory 166 */ 167 private function updateFrom_010000() 168 { 169 mkdir(GPCCore::getPiwigoSystemPath().self::KML_DIRECTORY, 0755, true); 170 171 $directory=scandir(GMAPS_PATH.'kml/'); 172 foreach($directory as $file) 173 { 174 $ext=(pathinfo($file, PATHINFO_EXTENSION)); 175 if(preg_match('/.*(?:\.kml|\.kmz)$/i', $file)) 176 { 177 rename(GMAPS_PATH.'kml/'.$file, GPCCore::getPiwigoSystemPath().self::KML_DIRECTORY.$file); 178 } 179 } 180 181 mkdir(GPCCore::getPiwigoSystemPath().self::KML_DIRECTORY); 182 183 184 $tablesUpdate=array( 185 $this->tables['images_tags'] => array( 186 'zoomLevelMaxActivated' => " ADD COLUMN `zoomLevelMaxActivated` CHAR(1) NOT NULL DEFAULT 'n' AFTER `style` ", 187 ) 188 ); 189 190 $tablef=new GPCTables(array($this->tables['maps'])); 191 $tablef->updateTablesFields($tablesUpdate); 192 193 unset($tablesUpdate); 194 } 195 152 196 } //class 153 197
Note: See TracChangeset
for help on using the changeset viewer.