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 |
$this->initialiser();
|
|
|
37 |
$cmd = $this->getParametre('a');
|
|
|
38 |
switch ($cmd) {
|
|
|
39 |
case 'creer' :
|
|
|
40 |
$nomDuScript = 'description_sp';
|
|
|
41 |
$parametresCli = array('-a' => 'integrer',
|
|
|
42 |
'-n' => $this->getParametre('d'),
|
|
|
43 |
'-v' => '3');
|
|
|
44 |
$this->dsc = new DescriptionSp($nomDuScript, $parametresCli);
|
|
|
45 |
$this->traiterInfo('RECUPERATION DES DESCRIPTIONS');
|
|
|
46 |
$this->dsc->executer();
|
|
|
47 |
|
|
|
48 |
$nomDuScript = 'cles';
|
|
|
49 |
$parametresCli = array('-a' => 'parser',
|
|
|
50 |
'-d' => $this->getParametre('c'),
|
|
|
51 |
'-v' => '3');
|
|
|
52 |
$this->cle = new Cles($nomDuScript, $parametresCli);
|
|
|
53 |
$this->traiterInfo('RECUPERATION DES CLES');
|
|
|
54 |
$this->cle->executer();
|
|
|
55 |
break;
|
|
|
56 |
|
|
|
57 |
default :
|
|
|
58 |
$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
|
|
|
59 |
}
|
|
|
60 |
}
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
?>
|