Subversion Repositories Applications.referentiel

Rev

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

Rev 325 Rev 326
Line 79... Line 79...
79
	
79
	
80
		// Initialisation des variables
80
		// Initialisation des variables
81
		$info = array();
81
		$info = array();
82
		$champs = array("titre", "code", "version", "domaine_taxo", "domaine_geo", "domaine_nom", "classification", "coordinateur", "auteur", "contributeur", "date_production", "source", "contact", "editeur", "droit", "licence", "referencement");
82
		$champs = array("titre", "code", "version", "domaine_taxo", "domaine_geo", "domaine_nom", "classification", "coordinateur", "auteur", "contributeur", "date_production", "source", "contact", "editeur", "droit", "licence", "referencement");
-
 
83
		$p = $this->traiterParametresUrl(array("ref","version"), $param, false);
83
		$p = $this->traiterParametresUrl(array("ref","version"), $param, false);
84
		$racine_tmp = Config::get('chemin_tmp');
84
		$fichier = '/home/delphine/tmp/'.date('Y_m_d')."/meta_".$p['version']."_".time().'.csv';
85
		$fichier = $racine_tmp.date('Y_m_d')."/meta_".$p['version']."_".time().'.csv';
85
		$requete = "SELECT '".implode("', '", $champs)."' UNION ( SELECT ".implode(", ", $champs).
86
		$requete = "SELECT '".implode("', '", $champs)."' UNION ( SELECT ".implode(", ", $champs).
86
				" INTO OUTFILE '".
87
				" INTO OUTFILE '".
87
			$fichier."' CHARACTER SET utf8 FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' ". 
88
			$fichier."' CHARACTER SET utf8 FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' ". 
88
			" FROM ".$p['ref']."_meta WHERE version = '".str_replace("_", ".", $p['version'])."')";
89
			" FROM ".$p['ref']."_meta WHERE version = '".str_replace("_", ".", $p['version'])."')";