|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | // Constants for the project |
4 | | -define('DATA_ROOT', realpath($server_config['root']) . '/'); |
5 | | -define('HG', realpath($server_config['local_hg']) . '/'); |
6 | | -define('GIT', realpath($server_config['local_git']) . '/'); |
7 | | -define('TMX', DATA_ROOT . 'TMX/'); |
8 | | -define('INSTALL_ROOT', realpath($server_config['install']) . '/'); |
9 | | -define('APP_SOURCES', realpath($server_config['config']) . '/sources/'); |
10 | | -define('WEB_ROOT', INSTALL_ROOT . 'web/'); |
11 | | -define('APP_ROOT', INSTALL_ROOT . 'app/'); |
12 | | -define('INC', APP_ROOT . 'inc/'); |
13 | | -define('VIEWS', APP_ROOT . 'views/'); |
14 | | -define('MODELS', APP_ROOT . 'models/'); |
15 | | -define('CONTROLLERS', APP_ROOT . 'controllers/'); |
| 4 | +define('DATA_ROOT', realpath($server_config['root']) . '/'); |
| 5 | +define('HG', realpath($server_config['local_hg']) . '/'); |
| 6 | +define('GIT', realpath($server_config['local_git']) . '/'); |
| 7 | +define('TMX', DATA_ROOT . 'TMX/'); |
| 8 | +define('INSTALL_ROOT', realpath($server_config['install']) . '/'); |
| 9 | +define('APP_SOURCES', realpath($server_config['config']) . '/sources/'); |
| 10 | +define('WEB_ROOT', INSTALL_ROOT . 'web/'); |
| 11 | +define('APP_ROOT', INSTALL_ROOT . 'app/'); |
| 12 | +define('INC', APP_ROOT . 'inc/'); |
| 13 | +define('VIEWS', APP_ROOT . 'views/'); |
| 14 | +define('MODELS', APP_ROOT . 'models/'); |
| 15 | +define('CONTROLLERS', APP_ROOT . 'controllers/'); |
16 | 16 | define('CACHE_ENABLED', isset($_GET['nocache']) ? false : true); |
17 | | -define('CACHE_PATH', INSTALL_ROOT . 'cache/'); |
18 | | -define('APP_SCHEME', isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://' : 'http://'); |
| 17 | +define('CACHE_PATH', INSTALL_ROOT . 'cache/'); |
| 18 | +define('APP_SCHEME', isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://' : 'http://'); |
19 | 19 |
|
20 | 20 | if (php_sapi_name() != 'cli') { |
21 | | - define('API_ROOT', APP_SCHEME . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_QUOTES, 'UTF-8') . '/api/v1/'); |
| 21 | + define('API_ROOT', APP_SCHEME . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_QUOTES, 'UTF-8') . '/api/v1/'); |
22 | 22 | } |
23 | 23 |
|
24 | 24 | /* |
|
39 | 39 | define('BETA_VERSION', $beta_version); |
40 | 40 |
|
41 | 41 | if (file_exists(CACHE_PATH . 'lastdataupdate.txt')) { |
42 | | - define('CACHE_TIME', time() - filemtime(CACHE_PATH . 'lastdataupdate.txt')); |
| 42 | + define('CACHE_TIME', time() - filemtime(CACHE_PATH . 'lastdataupdate.txt')); |
43 | 43 | } else { |
44 | 44 | // 05h20 cache (because we extract data every 6h and extraction lasts 25mn) |
45 | | - define('CACHE_TIME', 19200); |
| 45 | + define('CACHE_TIME', 19200); |
46 | 46 | } |
47 | 47 |
|
48 | 48 | // Special modes for the app |
49 | | -define('DEBUG', BETA_VERSION || isset($_GET['debug'])); |
| 49 | +define('DEBUG', BETA_VERSION || isset($_GET['debug'])); |
50 | 50 | define('LOCAL_DEV', isset($server_config['dev']) && $server_config['dev']); |
51 | 51 |
|
52 | 52 | // Set perf_check=true in config.ini to log page time generation and memory used while in DEBUG mode |
|
0 commit comments