46,7 → 46,7 |
|
// Gestion des classes principales des modules |
$module = strtolower(str_replace(' ', '_', preg_replace('/([a-z])([A-Z])/', '$1 $2',$classe))); |
$fichier = ES_CHEMIN_MODULE.$module.DS.$classe.'.php'; |
$fichier = ES_CHEMIN_MODULE.$module.DS.$classe.'.class.php'; |
if (file_exists($fichier)) { |
require_once $fichier; |
} |
53,49 → 53,35 |
|
// Gestion des bibliothèques des scripts |
foreach ($GLOBALS['chemins_autoload'] as $chemin) { |
$fichier = $chemin.$classe.'.php'; |
$fichiers = array( $chemin.$classe.'.class.php', |
$chemin.$classe.'.php'); |
|
if (file_exists($fichier)) { |
require_once $fichier; |
break; |
foreach ($fichiers as $fichier) { |
if (file_exists($fichier)) { |
require_once $fichier; |
break; |
} |
} |
} |
} |
|
// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application. |
// Sinon, rien ne sera chargé. |
// Chemin du fichier chargeant le framework requis |
$framework = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'interfaces'.DIRECTORY_SEPARATOR.'framework.php'; |
if (!file_exists($framework)) { |
$e = "Veuillez paramêtrer l'emplacement et la version du Framework dans le fichier $framework"; |
trigger_error($e, E_USER_ERROR); |
} else { |
// Inclusion du Framework |
require_once $framework; |
// Ajout d'information concernant cette application |
Application::setChemin(__FILE__);// Obligatoire |
Application::setInfo(Config::get('info')); |
/** |
* récupération du nom de la commande et éventuellement du nom de l'application |
*/ |
if ($_SERVER['argc'] < 2){ |
die("Erreur: pas de commande. Voir '".$_SERVER['argv'][0]." help'.\n"); |
} |
|
/** |
* récupération du nom de la commande et éventuellement du nom de l'application |
*/ |
if ($_SERVER['argc'] < 2){ |
die("Erreur: pas de commande. Voir '".$_SERVER['argv'][0]." help'.\n"); |
} |
|
$argv = $_SERVER['argv']; |
$script_nom = array_shift($argv); // shift le nom du script |
$commande_nom = array_shift($argv); // prend le nom de la commande |
|
// Chargement de la commande |
$Script = Script::charger($commande_nom); |
$parametres = Script::getParametres($argv); |
|
// Lancement de la commande |
$Script->initialiser($parametres); |
$Script->executer(); |
|
// Affichage des execptions et erreurs générées par le script |
echo GestionnaireException::getExceptions(); |
} |
$argv = $_SERVER['argv']; |
$script_nom = array_shift($argv); // shift le nom du script |
$commande_nom = array_shift($argv); // prend le nom de la commande |
|
// Chargement de la commande |
$Script = Script::charger($commande_nom); |
$parametres = Script::getParametres($argv); |
|
// Lancement de la commande |
$Script->initialiser($parametres); |
$Script->executer(); |
|
?> |