forked from carlosmartins/igrape
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·102 lines (89 loc) · 2.29 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/**
* iGrape Framework
*
* @category iGrape
* @author iGrape Dev Team
* @copyright Copyright (c) 2007-2010 iGrape Inc. (http://www.igrape.org)
* @license /LICENSE.txt New BSD License
* @version $Id: index.php 10096 2010-03-08 14:05:09Z $
*/
/*
|---------------------------------------------------------------
| PHP ERROR REPORTING LEVEL
|---------------------------------------------------------------
|
| For more info visit: http://www.php.net/error_reporting
|
*/
ob_start();
session_start();
error_reporting(E_ALL);
ini_set('display_errors',1);
set_time_limit(0);
//ignore_user_abort();
/*
|-------------------------------------------------------------
| OS used
|-------------------------------------------------------------
|
| win = Windows
| lin = Linux
| bsd = BSD
| osx = Mac OS X
|
*/
define("OS", "lin");
/*
|-------------------------------------------------------------
| iGrape folders
|-------------------------------------------------------------
|
| win = Windows
| lin = Linux
| bsd = BSD
| osx = Mac OS X
|
*/
define("SYS", "system");
define("APP", "application");
define("DS", "/");
/*
|-------------------------------------------------------------
| In the system (CONSTANTS)
|-------------------------------------------------------------
|
| --
|
*/
define('EXT', '.php');
define('EXTPL', '.theme.php');
define('APPBASE', is_dir(APP.DS)?APP.DS:"application"."/");
define('SYSBASE', is_dir(SYS.DS)?SYS.DS:"system"."/");
define('CONFBASE', APPBASE.'config'.DS);
define('MODELSBASE', APPBASE.'models'.DS);
define('LIB', SYSBASE.'libraries'.DS);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define("PATH", realpath(dirname(__FILE__)));
define('COREPATH', LIB.'igrape'.DS);
define('COREFILE', COREPATH.'core'.EXT);
define('SYSROOT', PATH.SYSBASE);
define('APPROOT', PATH.APPBASE);
define('CONFROOT', APPROOT.'config'.DS);
define('COREROOT', PATH.DS.COREPATH);
define('CGI', 1);
if(defined('CGI')) {
$cmd = @substr($_SERVER['argv'][0],1);
define('SCRIPT_NAME', '?');
}else{
$cmd = @substr($_SERVER['PATH_INFO'],1);
define('SCRIPT_NAME', '/');
}
$sn = dirname($_SERVER['SCRIPT_NAME']);
if($sn != "/") $sn .= '/';
define('WEBROOT', $sn);
define('LOGOUT_TRIGGER', "logout");
require_once COREFILE;
new iGrape($cmd);
ob_flush();
?>