Subversion Repositories Applications.framework

Rev

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

Rev 387 Rev 477
Line 12... Line 12...
12
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
12
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
13
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
13
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
14
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
14
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
15
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
15
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
16
 * @since 		0.3
16
 * @since 		0.3
17
 * @version	$Id: Cli.php 387 2011-10-28 15:57:40Z jpm $
17
 * @version	$Id: Cli.php 477 2014-03-25 10:39:28Z jpm $
18
 * @link		/doc/framework/
18
 * @link		/doc/framework/
19
 */
19
 */
Line 20... Line 20...
20
 
20
 
Line 54... Line 54...
54
 
54
 
55
		// Fin d'execution
55
		// Fin d'execution
56
		exit(0);
56
		exit(0);
Line 57... Line 57...
57
	}
57
	}
58
 
58
 
59
	private static function charger($script_nom, $parametres) {
59
	private static function charger($script_nom_original, $parametres) {
Line -... Line 60...
-
 
60
		$Script = null;
60
		$Script = null;
61
		Config::verifierPresenceParametres(self::$parametres_obligatoires);
61
		Config::verifierPresenceParametres(self::$parametres_obligatoires);
62
 
62
 
63
 
63
		if (strpos($script_nom, DS)) {
64
		if (strpos($script_nom_original, DS)) {
64
			$decompoScriptNom = explode(DS, $script_nom);
65
			$decompoScriptNom = explode(DS, $script_nom_original);
65
			$script_nom = array_pop($decompoScriptNom);
66
			$script_nom = array_pop($decompoScriptNom);
66
			$dossier_nom = implode(DS, $decompoScriptNom);
67
			$dossier_nom = implode(DS, $decompoScriptNom);
Line 67... Line 68...
67
		} else {
68
		} else {
68
			$dossier_nom = strtolower($script_nom);
69
			$dossier_nom = strtolower($script_nom_original);
Line 76... Line 77...
76
		} else {
77
		} else {
77
			require_once $fichier_script;
78
			require_once $fichier_script;
78
			if (!class_exists( $classe_nom)) {
79
			if (!class_exists( $classe_nom)) {
79
				trigger_error("Erreur: impossible de trouver la classe de la commande : $classe_nom\n", E_USER_ERROR);
80
				trigger_error("Erreur: impossible de trouver la classe de la commande : $classe_nom\n", E_USER_ERROR);
80
			} else {
81
			} else {
81
				$Script = new $classe_nom($script_nom, $parametres);
82
				$Script = new $classe_nom($script_nom_original, $parametres);
82
			}
83
			}
83
		}
84
		}
84
		return $Script;
85
		return $Script;
85
	}
86
	}