Subversion Repositories Applications.wikini

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
50 aurelien 1
<?php
2
// Encodage : UTF-8
3
// +-------------------------------------------------------------------------------------------------------------------+
4
/**
5
* Initialise le chargement et l'exécution des scripts
6
*
7
* Lancer ce fichier en ligne de commande avec :
8
* <code>/opt/lampp/bin/php cli.php mon_script -a test</code>
9
*
10
 * @category   CEL
11
 * @package    Scripts
12
 * @author     Mathias CHOUET <mathias@tela-botanica.org>
13
 * @author     Jean-Pascal MILCENT <jpm@tela-botanica.org>
14
 * @author     Aurelien PERONNET <aurelien@tela-botanica.org>
15
 * @license    GPL v3 <http://www.gnu.org/licenses/gpl.txt>
16
 * @license    CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
17
 * @copyright  1999-2014 Tela Botanica <accueil@tela-botanica.org>
18
 */
19
 
20
// Le fichier Framework.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
21
// Sinon, rien ne sera chargé.
22
// Chemin du fichier chargeant le framework requis
23
$framework = dirname(__FILE__).DIRECTORY_SEPARATOR.'framework.php';
24
if (!file_exists($framework)) {
25
	$e = "Veuillez paramétrer l'emplacement et la version du Framework dans le fichier $framework";
26
	trigger_error($e, E_USER_ERROR);
27
} else {
28
	// Inclusion du Framework
29
	require_once $framework;
30
 
31
	// Ajout d'information concernant cette application
32
	Framework::setCheminAppli(__FILE__);// Obligatoire
33
	Framework::setInfoAppli(Config::get('info'));
34
 
35
	// Création de l'objet Wiki qui sera transmis au service via le Registre
36
	Registre::set('cheminApi', getcwd());
37
	Registre::set('cheminWiki', realpath(dirname(__FILE__).DS.'..'.DS.'..'.DS).DS);
38
	//require_once(getcwd().DS.'bibliotheque'.DS.'WikiApi.php');
39
	$wikiApi = new WikiApi(Registre::get('cheminWiki'), Registre::get('cheminApi'));
40
	Registre::set('wikiApi', $wikiApi);
41
 
42
	// Initialisation et lancement du script appelé en ligne de commande
43
	Cli::executer();
44
}