Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 11 | Blame | Last modification | View Log | RSS feed

<?php
/**
 * Classe permettant de lancer plusieurs scripts consécutivement.
 * Exemple :
 * /opt/lampp/bin/php cli.php description_sp -a coste/creation_projet_coste -a creer
 *              -d /home/jpm/eflore/donnees/coste/descriptions/html
 *              -c /home/jpm/eflore/donnees/coste/cles/html
 *
 * @category    php 5.2
 * @package             eflore/scripts/coste
 * @author              Jennifer DHÉ <jennifer@tela-botanica.org>
 * @author              Jean-Pascal MILCENT <jpm@tela-botanica.org>
 * @copyright   Copyright (c) 2011, Tela Botanica (accueil@tela-botanica.org)
 * @license             http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
 * @license             http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
 * @version             $Id$
 */
class CreationProjetCoste extends Script {

        // commande :  /opt/lampp/bin/php cli.php creation_projet_coste -a creer -v 3

        protected $cle;
        protected $dsc;
        protected $creationTable;
        protected $parametres_autorises = array(
                '-d' => array(false, null, 'nom du dossier contenant les descriptions à analyser'),
                '-c' => array(false, null, 'nom du fichier contenant les clés à analyser'));

        public function initialiser() {
                $this->bdd = new Bdd();
                require_once './Cles.php';
                require_once './DescriptionSp.php';
        }

        public function executer() {
                $this->initialiser();
                $cmd = $this->getParametre('a');
            switch ($cmd) {
                        case 'creer' :
                                $nomDuScript = 'description_sp';
                                $parametresCli = array('-a' => 'integrer',
                                        '-n' => $this->getParametre('d'),
                                        '-v' => '3');
                                $this->dsc = new DescriptionSp($nomDuScript, $parametresCli);
                                $this->traiterInfo('RECUPERATION DES DESCRIPTIONS');
                                $this->dsc->executer();

                                $nomDuScript = 'cles';
                                $parametresCli = array('-a' => 'parser',
                                        '-d' => $this->getParametre('c'),
                                        '-v' => '3');
                                $this->cle = new Cles($nomDuScript, $parametresCli);
                                $this->traiterInfo('RECUPERATION DES CLES');
                                $this->cle->executer();
                                break;

                        default :
                                $this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
                }
    }
}

?>