Subversion Repositories eFlore/Applications.cel

Rev

Rev 3466 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3466 Rev 3512
Line 152... Line 152...
152
	}
152
	}
Line 153... Line 153...
153
	
153
	
154
	private function migrerImages() {
154
	private function migrerImages() {
155
	    $requete = "INSERT INTO ".$this->bd_new_cel.".photo
155
	    $requete = "INSERT INTO ".$this->bd_new_cel.".photo
156
	        (id, occurrence_id, user_id, user_pseudo, user_email, date_shot, original_name, mime_type,
156
	        (id, occurrence_id, user_id, user_pseudo, user_email, date_shot, original_name, mime_type,
157
	        date_updated, date_created, date_linked_to_occurrence, content_url, url)
157
	        date_updated, date_created, date_linked_to_occurrence, content_url, size, url)
158
	        SELECT id_image, ce_observation, ce_utilisateur, prenom_utilisateur, 
158
	        SELECT id_image, ce_observation, ce_utilisateur, prenom_utilisateur, 
159
	        courriel_utilisateur, date_prise_de_vue, nom_original,'' , date_modification, 
159
	        courriel_utilisateur, date_prise_de_vue, nom_original,'' , date_modification, 
160
	        date_creation, date_liaison, '', concat('https://api.tela-botanica.org/img:', 
160
	        date_creation, date_liaison, '', '6444444',concat('https://api.tela-botanica.org/img:', 
161
	        lpad(`id_image`, 9, '0'), 'O')
161
	        lpad(`id_image`, 9, '0'), 'O')
162
	        FROM ".$this->bd_cel.".cel_images";
162
	        FROM ".$this->bd_cel.".cel_images";
163
	    $this->bdd->requeter($requete);
163
	    $this->bdd->requeter($requete);
164
	    $requete_jpg = 'UPDATE `photo` SET `mime_type` = "image/jpeg", `content_url`= concat('.Config::get('nettoyage.chemin_photo').
164
	    $requete_jpg = 'UPDATE `photo` SET `mime_type` = "image/jpeg", `content_url`= concat('.Config::get('nettoyage.chemin_photo').
165
	        ',substr(lpad(id, 9, "0"),1,3),"/",substr(lpad(id, 9, "0"),4,3),"/O/",substr(lpad(id, 9, "0"),1,3),"_",substr(lpad(id, 9, "0"),4,3),"_",substr(lpad(id, 9, "0"),7,3),"_O.",substr(`original_name` , char_length(`original_name`) - locate('.', reverse(`original_name`)) +1, locate('.', reverse(`original_name`))))
165
	        ',substr(lpad(id, 9, "0"),1,3),"/",substr(lpad(id, 9, "0"),4,3),"/O/",substr(lpad(id, 9, "0"),1,3),"_",substr(lpad(id, 9, "0"),4,3),"_",substr(lpad(id, 9, "0"),7,3),"_O",substr(`original_name` , char_length(`original_name`) - locate('.', reverse(`original_name`)) +1, locate('.', reverse(`original_name`))))
166
	        WHERE `original_name` like "%.jp%" and content_url = ""';
166
	        WHERE `original_name` like "%.jp%" and content_url = ""';
167
	    $this->bdd->requeter($requete_jpg);
167
	    $this->bdd->requeter($requete_jpg);
168
	    $requete_png = 'UPDATE `photo` SET `mime_type` = "image/png", `content_url`= concat('.Config::get('nettoyage.chemin_photo').
168
	    $requete_png = 'UPDATE `photo` SET `mime_type` = "image/png", `content_url`= concat('.Config::get('nettoyage.chemin_photo').
169
	        ',substr(lpad(id, 9, "0"),1,3),"/",substr(lpad(id, 9, "0"),4,3),"/O/",substr(lpad(id, 9, "0"),1,3),"_",substr(lpad(id, 9, "0"),4,3),"_",substr(lpad(id, 9, "0"),7,3),"_O.",substr(`original_name` , char_length(`original_name`) - locate('.', reverse(`original_name`)) +1, locate('.', reverse(`original_name`))))
169
	        ',substr(lpad(id, 9, "0"),1,3),"/",substr(lpad(id, 9, "0"),4,3),"/O/",substr(lpad(id, 9, "0"),1,3),"_",substr(lpad(id, 9, "0"),4,3),"_",substr(lpad(id, 9, "0"),7,3),"_O",substr(`original_name` , char_length(`original_name`) - locate('.', reverse(`original_name`)) +1, locate('.', reverse(`original_name`))))
170
	        WHERE `original_name` like "%.png" and content_url = ""';
170
	        WHERE `original_name` like "%.png" and content_url = ""';
-
 
171
	    $this->bdd->requeter($requete_png);
-
 
172
	    'UPDATE `photo` SET `mime_type` = "image/jpeg", `content_url`= concat('.Config::get('nettoyage.chemin_photo').
-
 
173
	        ',substr(lpad(id, 9, "0"),1,3),"/",substr(lpad(id, 9, "0"),4,3),"/O/",substr(lpad(id, 9, "0"),1,3),"_",substr(lpad(id, 9, "0"),4,3),"_",substr(lpad(id, 9, "0"),7,3),"_O.jpg")
171
	    $this->bdd->requeter($requete_png);
174
	        WHERE content_url = "" and (`original_name` != "" or `original_name` is null)';
Line 172... Line 175...
172
	}
175
	}
173
 
176
 
174
	private function migrerMotsClesImages() {
177
	private function migrerMotsClesImages() {