Subversion Repositories Applications.papyrus

Rev

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

Rev Author Line No. Line
2005 Aurelien 1
<?php
2007 Aurélien 2
3
function lancerCodeIgniter($nom_appli) {
2005 Aurelien 4
5
 	$_GET['c'] = $nom_appli ;
6
 	$GLOBALS['retour'] = '' ;
7
8
 	error_reporting(E_ALL);
9
10
	$system_folder = PAP_CHEMIN_RACINE.'papyrus/bibliotheque/system';
11
12
	$application_folder = GEN_CHEMIN_APPLICATION.$nom_appli;
13
14
	if (strpos($system_folder, '/') === FALSE) {
15
		if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE) {
16
			$system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
17
		}
18
	} else {
19
		// Swap directory separators to Unix style for consistency
20
		$system_folder = str_replace("\\", "/", $system_folder);
21
	}
22
23
	define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
24
	define('FCPATH', __FILE__);
25
	define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
26
	define('BASEPATH', $system_folder.'/');
27
28
	if (is_dir($application_folder)) {
29
		define('APPPATH', $application_folder.'/');
30
	} else {
31
		if ($application_folder == '') {
32
			$application_folder = 'application';
33
		}
34
		define('APPPATH', BASEPATH.$application_folder.'/');
35
	}
36
37
	require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;
38
39
	return $GLOBALS['retour'] ;
40
 }
41
42
?>