Subversion Repositories eFlore/Applications.del

Rev

Rev 1737 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1135 aurelien 1
<?php
2
//declare(encoding='UTF-8');
3
/**
4
 * Exemple de lancement du script : :
1683 jpm 5
 * /opt/lampp/bin/php cli.php adeterminer -a alerteMail
1135 aurelien 6
 *
1683 jpm 7
 * @category	php 5.4
8
 * @package		DEL
9
 * @subpackage	Scripts
1135 aurelien 10
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
1683 jpm 11
 * @copyright	Copyright (c) 2012-2014, Tela Botanica (accueil@tela-botanica.org)
12
 * @license		CeCILL v2 http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt
13
 * @license		GNU-GPL http://www.gnu.org/licenses/gpl.html
1135 aurelien 14
 */
15
class Adeterminer extends DelScript {
16
 
1737 jpm 17
	protected $parametres_autorises = array(
18
		'-t' => array(false, true, 'pour tester le script indiquer votre e-mail'));
19
 
1135 aurelien 20
	public function executer() {
21
		try {
22
			$this->initialiserProjet('adeterminer');
23
 
24
			// Lancement de l'action demandée
25
			$cmd = $this->getParametre('a');
26
			switch ($cmd) {
27
				case 'alerteMail' :
28
					$script = $this->chargerClasse('AlerteMailADeterminer');
29
					$script->executer();
30
					break;
31
				default :
32
					throw new Exception("Erreur : la commande '$cmd' n'existe pas!");
33
			}
34
		} catch (Exception $e) {
35
			$this->traiterErreur($e->getMessage());
36
		}
37
	}
1683 jpm 38
 
1135 aurelien 39
	private function chargerClasse($classe) {
40
		require_once $classe.'.php';
1683 jpm 41
		$conteneur = new Conteneur($this->parametres);
42
		return new $classe($conteneur);
1135 aurelien 43
	}
44
}
45
?>