Subversion Repositories eFlore/Projets.eflore-projets

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
11 jpm 1
<?php
2
/**
3
 * Classe permettant de lancer plusieurs scripts consécutivement.
4
 * Exemple :
5
 * /opt/lampp/bin/php cli.php description_sp -a coste/creation_projet_coste -a creer
6
 * 		-d /home/jpm/eflore/donnees/coste/descriptions/html
7
 * 		-c /home/jpm/eflore/donnees/coste/cles/html
8
 *
9
 * @category	php 5.2
10
 * @package		eflore/scripts/coste
11
 * @author		Jennifer DHÉ <jennifer@tela-botanica.org>
12
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
13
 * @copyright	Copyright (c) 2011, Tela Botanica (accueil@tela-botanica.org)
14
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
15
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
16
 * @version		$Id$
17
 */
18
class CreationProjetCoste extends Script {
19
 
20
	// commande :  /opt/lampp/bin/php cli.php creation_projet_coste -a creer -v 3
21
 
22
	protected $cle;
23
	protected $dsc;
24
	protected $creationTable;
25
	protected $parametres_autorises = array(
26
		'-d' => array(false, null, 'nom du dossier contenant les descriptions à analyser'),
27
		'-c' => array(false, null, 'nom du fichier contenant les clés à analyser'));
28
 
29
	public function initialiser() {
30
		$this->bdd = new Bdd();
31
		require_once './Cles.php';
32
		require_once './DescriptionSp.php';
33
	}
34
 
35
	public function executer() {
36
 
37
		$this->initialiser();
38
		$cmd = $this->getParametre('a');
39
	    switch ($cmd) {
40
			case 'creer' :
41
				$nomDuScript = 'description_sp';
42
				$parametresCli = array('-a' => 'integrer',
43
					'-n' => $this->getParametre('d'),
44
					'-v' => '3');
45
				$this->dsc = new DescriptionSp($nomDuScript, $parametresCli);
46
				$this->traiterInfo('RECUPERATION DES DESCRIPTIONS');
47
				$this->dsc->executer();
48
 
49
				$nomDuScript = 'cles';
50
				$parametresCli = array('-a' => 'parser',
51
					'-d' => $this->getParametre('c'),
52
					'-v' => '3');
53
				$this->cle = new Cles($nomDuScript, $parametresCli);
54
				$this->traiterInfo('RECUPERATION DES CLES');
55
				$this->cle->executer();
56
				break;
57
 
58
			default :
59
				$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
60
		}
61
    }
62
}
63
 
64
?>