Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 687 → Rev 688

/trunk/scripts/modules/baseflor/Baseflor.php
5,8 → 5,8
class Baseflor extends EfloreScript {
 
private $table = null;
 
 
public function executer() {
try {
$this->initialiserProjet('baseflor');
22,7 → 22,7
$this->chargerOntologies();
break;
case 'verifierFichier' :
$this->verifierFichier();
$this->verifierFichier();
break;
case 'chargerDonnees' :
$this->chargerDonnees();
62,9 → 62,9
}
}
 
 
//-- traitement de la table baseflorRangSupInsertion --//
 
private function getClasseBaseflorRangSupInsertion() {
$conteneur = new Conteneur();
require_once dirname(__FILE__)."/BaseflorRangSupInsertion.php";
71,25 → 71,25
$rangSupInsert = new BaseflorRangSupInsertion($conteneur, $this->getBdd());
return $rangSupInsert;
}
 
private function insererDonneesBaseflorRangSupEcolo(){
$rangSupInsert = $this->getClasseBaseflorRangSupInsertion();
$rangSupInsert->insererDonnees();
}
 
private function voirRangSup(){
$rangSupInsert = $this->getClasseBaseflorRangSupInsertion();
$rangSupInsert->testAscendantsDeBaseflor();
}
 
private function voirRangSupEcologie(){
$rangSupInsert = $this->getClasseBaseflorRangSupInsertion();
$rangSupInsert->testEcologieAscendantsDeBaseflor();
}
 
 
//-- traitement de la table baseflorIndex --//
 
private function getClasseBaseflorIndex() {
$conteneur = new Conteneur();
require_once dirname(__FILE__)."/BaseflorIndex.php";
96,15 → 96,15
$Index = new BaseflorIndex($conteneur, $this->getBdd());
return $Index;
}
 
private function insererDonneesIndex(){
$Index= $this->getClasseBaseflorIndex();
$Index->insererDonnees();
}
 
 
//-- traitement de la table generer champs --//
 
private function genererChamps(){
$this->initialiserGenerationChamps();
$this->ajouterChamps();
265,7 → 265,7
}
}
 
private function chargerDonnees() {
private function chargerDonnees() {
$nb_err = $this->verifierFichier();
if ($nb_err > 0) {
$e = "Je ne peux pas charger les données car le fichier comporte des erreurs.".
285,8 → 285,11
}
 
private function supprimerTous() {
$requete = "DROP TABLE IF EXISTS baseflor_meta, baseflor_ontologies, baseflor_v2012_05_08,".
" baseflor_rang_sup_ecologie_v2012_05_08, baseflor_index_v2012_05_08 ";
// TODO : rajouter une boucle utilisant un parametre de config stockant toutes les versions pour supprimer les tables
$requete = "DROP TABLE IF EXISTS baseflor_meta, baseflor_ontologies, ".
" baseflor_v2012_03_19, ".
" baseflor_v2012_05_08, baseflor_rang_sup_ecologie_v2012_05_08, baseflor_index_v2012_05_08, ".
" baseflor_v2012_12_31, baseflor_rang_sup_ecologie_v2012_12_31 ";
$this->getBdd()->requeter($requete);
}
 
298,12 → 301,12
$verif = new BaseflorVerif($conteneur,'baseflor');
return $verif;
}
 
private function verifierFichier() {
$verif = $this->getClasseBaseflorVerif();
$nb_erreurs = $verif->verifierFichier(Config::get('chemins.donnees'));
return $nb_erreurs;
}
 
}
?>