New file |
0,0 → 1,104 |
<?php |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com | |
// |@version 3 | |
|
// +------------------------------------------------------------------------------------------------------+ |
/* |
*fichier contenant le menu principal de l'application de gestion du temps de travail |
*@package gtt_general |
//Auteur original : |
*@author Dorian Bannier <dbannier@aol.com> |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Copyright (C) 2003 Tela-Botanica |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | INCLUSION DE FICHIERS | |
// +------------------------------------------------------------------------------------------------------+ |
|
// Fichiers de la bibliotheque PEAR |
include 'gtt_config.inc.php'; |
if (!file_exists('config.inc.php')) { |
die('Veuillez configurer la base de données de la Gestion du Temps de travail en complétant puis en renommant en config.inc.php le fichier config.inc.defaut.php.'); |
} |
include 'config.inc.php'; |
include GTT_CHEMIN_LANGUE.'gtt_langue_'.GTT_LANGUE.'.inc.php'; |
|
// Gestion de l'action à executer par défaut |
if (empty($_GET['action'])) { |
$_GET['action'] = 'identification'; |
} |
// Gestion du format du template |
if (empty($_GET['format'])) { |
$_GET['format'] = 'html'; |
} |
// Gestion du type de sortie par défaut |
if (empty($_GET['sortie'])) { |
$_GET['sortie'] = $_GET['format']; |
} |
|
// Initialisation du Gestionnaire d'erreurs |
$GLOBALS['_GTT_']['erreur'] = new GestionnaireErreur(GTT_DEBOGAGE_CONTEXTE); |
$GLOBALS['_GTT_']['erreur']->setNiveauErreurCourrant(GTT_DEBOGAGE_NIVEAU); |
|
// Initialisation du Chronomêtre |
$GLOBALS['_GTT_']['chrono'] = new Chronometre(); |
|
// Connexion à la base de données |
$GLOBALS['db'] = DB::connect(GTT_BDD_DSN); |
if (PEAR::isError($GLOBALS['db'])) { |
trigger_error("Échec connexion à la base de données : ".$GLOBALS['db']->getMessage(), E_USER_ERROR); |
} |
// Utilisation de l'utf-8 |
if (PEAR::isError($GLOBALS['db']->query('SET NAMES "utf8"'))) { |
trigger_error("Échec de l'utilisation d'UTF-8 : ".$GLOBALS['db']->getMessage(), E_USER_WARNING); |
} |
|
// Utilisation du mécanisme MVC avec Squelette PHP et objet |
$Controlleur = new ControlleurFrontal($_GET['action'], $_GET['format'], $_GET['sortie']); |
$Controlleur->executer(); |
|
/** |
* La fonction __autoload() charge dynamiquement les classes trouvées dans le code. |
* |
* Cette fonction est appelée par php5 quand il trouve une instanciation de classe dans le code. |
* |
*@param string le nom de la classe appelée. |
*@return void le fichier contenant la classe doit être inclu par la fonction. |
*/ |
function __autoload($classe) |
{ |
$fichier_classe_pear = GTT_CHEMIN_PEAR.str_replace('_', '/', $classe).'.php'; |
if (file_exists($fichier_classe_pear)) { |
require_once $fichier_classe_pear; |
} else { |
$nom_classe_gtt = $classe.'.class.php'; |
foreach ($GLOBALS['_GTT_']['tab_chemin_autoload'] as $chemin) { |
$fichier = $chemin.$nom_classe_gtt; |
if (file_exists($fichier)) { |
require_once $fichier; |
} |
} |
} |
} |
|
?> |
Property changes: |
Added: svn:executable |