Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 687 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 687 Rev 1074
Line 26... Line 26...
26
					$this->chargerCel();
26
					$this->chargerCel();
27
					break;
27
					break;
28
				case 'supprimerTous' :
28
				case 'supprimerTous' :
29
					$this->supprimerTous();
29
					$this->supprimerTous();
30
					break;
30
					break;
-
 
31
				case 'genererScriptTableReference' :
-
 
32
					$this->genererScriptTableReference();
-
 
33
					break;
31
				default :
34
				default :
32
					throw new Exception("Erreur : la commande '$cmd' n'existe pas!");
35
					throw new Exception("Erreur : la commande '$cmd' n'existe pas!");
33
			}
36
			}
34
		} catch (Exception $e) {
37
		} catch (Exception $e) {
35
			$this->traiterErreur($e->getMessage());
38
			$this->traiterErreur($e->getMessage());
Line 88... Line 91...
88
	private function supprimerTous() {
91
	private function supprimerTous() {
89
		$requete = "DROP TABLE IF EXISTS cel_meta, cel_images, cel_inventory, cel_mots_cles_images, cel_mots_cles_obs, ".
92
		$requete = "DROP TABLE IF EXISTS cel_meta, cel_images, cel_inventory, cel_mots_cles_images, cel_mots_cles_obs, ".
90
			"cel_obs_images, locations ";
93
			"cel_obs_images, locations ";
91
		$this->getBdd()->requeter($requete);
94
		$this->getBdd()->requeter($requete);
92
	}
95
	}
-
 
96
	
-
 
97
	private function genererScriptTableReference() {
-
 
98
		$script_sql = file_get_contents(__DIR__.'/cel_references.tpl.sql');
-
 
99
		$config_references = Config::get('references');
-
 
100
		foreach($config_references as $a_remplacer => $remplacement) {
-
 
101
			$script_sql = str_replace($a_remplacer, $remplacement, $script_sql);
-
 
102
			file_put_contents(__DIR__.'/cel_references_gen.sql', $script_sql);
-
 
103
		}
-
 
104
	}
93
}
105
}
94
?>
106
?>
95
107