-
Notifications
You must be signed in to change notification settings - Fork 0
/
paths.php
executable file
·130 lines (107 loc) · 2.55 KB
/
paths.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
/**
* @file paths.php
* @brief Jeff system paths definition.
*
* @author abidibo [email protected]
* @version 0.99
* @date 2011-2012
* @copyright Otto srl [MIT License](http://www.opensource.org/licenses/mit-license.php)
*/
/**
* @brief absolute path to the ADMIN ROOT directory
*/
define('ABS_ADMIN', ABS_ROOT.DS.'admin');
/**
* @brief absolute path to the upload directory
*/
define('ABS_UPLOAD', ABS_ROOT.DS.'upload');
/**
* @brief absolute path to the cache directory
*/
define('ABS_CACHE', ABS_ROOT.DS.'cache');
/**
* @brief absolute path to the core directory
*/
define('ABS_CORE', ABS_ROOT.DS.'core');
/**
* @brief absolute path to the MVC directory,
*
* Contains the primitive mvc classes
*/
define('ABS_MVC', ABS_CORE.DS.'mvc');
/**
* @brief absolute path to the lib directory
*/
define('ABS_LIB', ABS_ROOT.DS.'lib');
/**
* @brief absolute path to the php libraries directory
*/
define('ABS_PHPLIB', ABS_LIB.DS.'php');
/**
* @brief absolute path to the themes directory
*/
define('ABS_THEMES', ABS_ROOT.DS.'themes');
/**
* @brief aboslute path to the modules directory
*/
define('ABS_MDL', ABS_ROOT.DS.'modules');
/**
* @brief absolute path to the core db directory
*/
define('ABS_DB', ABS_CORE.DS.'db');
/**
* @brief absolute path to the core theme directory
*/
define('ABS_THEME', ABS_CORE.DS.'theme');
/**
* @brief absolute path to the core template directory
*/
define('ABS_TEMPLATE', ABS_CORE.DS.'template');
/**
* @brief absolute path to the plugins directory
*/
define('ABS_PLUGINS', ABS_ROOT.DS.'plugins');
if(strrpos(php_uname(), "Windows")!==false) {
$os = 'win';
$sdocroot = preg_replace("#/#", "\\", $_SERVER['DOCUMENT_ROOT']);
$root = preg_replace("#".preg_quote($sdocroot)."#", "", ABS_ROOT);
$root_const = $root[0] != '/' ? '/'.$root : $root;
}
else {
if(strrpos(php_uname(), "Darwin")!==false) {
$os = 'mac';
}
elseif(strrpos(php_uname(), "Linux")!==false) {
$os = 'linux';
}
else {
$os = 'undefined';
}
$root_const = preg_replace("#".$_SERVER['DOCUMENT_ROOT']."#", "", ABS_ROOT);
}
/**
* @brief server operating system
*/
define('OS', $os);
/**
* @brief relative path to ROOT directory
*/
define('ROOT', $root_const);
/**
* @brief relative path to ADMIN ROOT dierctory
*/
define('ROOT_ADMIN', ROOT.'/admin');
/**
* @brief relative path to javascript libraries
*/
define('REL_JSLIB', ROOT.'/lib/js');
/**
* @brief relative path to css directory
*/
define('REL_CSS', ROOT.'/css');
/**
* @brief relative path to upload directory
*/
define('REL_UPLOAD', ROOT.'/upload');
?>