forked from fansoro/fansoro.org
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·79 lines (65 loc) · 1.74 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
<?php
/**
* Morfy requires PHP 5.3.0 or greater
*/
if (version_compare(PHP_VERSION, "5.3.0", "<")) {
exit("Morfy requires PHP 5.3.0 or greater.");
}
/**
* Define the path to the root directory (without trailing slash).
*/
define('ROOT_DIR', __DIR__);
/**
* Define the path to the content directory (without trailing slash).
*/
define('CONTENT_PATH', ROOT_DIR .'/content');
/**
* Define the path to the blocks directory (without trailing slash).
*/
define('BLOCKS_PATH', CONTENT_PATH .'/blocks');
/**
* Define the path to the pages directory (without trailing slash).
*/
define('PAGES_PATH', CONTENT_PATH .'/pages');
/**
* Define the path to the libraries directory (without trailing slash).
*/
define('LIBRARIES_PATH', ROOT_DIR .'/libraries');
/**
* Define the path to the themes directory (without trailing slash).
*/
define('THEMES_PATH', ROOT_DIR .'/themes');
/**
* Define the path to the plugins directory (without trailing slash).
*/
define('PLUGINS_PATH', ROOT_DIR .'/plugins');
/**
* Define the path to the cache directory (without trailing slash).
*/
define('CACHE_PATH', ROOT_DIR .'/cache');
/**
* Define the path to the config directory (without trailing slash).
*/
define('CONFIG_PATH', ROOT_DIR .'/config');
/**
* Load Morfy
*/
require LIBRARIES_PATH . '/Morfy/Morfy.php';
/**
* First check for installer then go
*/
if (file_exists('install.php')) {
if (isset($_GET['install']) && $_GET['install'] == 'done') {
// Try to delete install file if not DELETE MANUALLY !!!
@unlink('install.php');
// Redirect to main page
header('location: index.php');
} else {
include 'install.php';
}
} else {
/**
* Run Morfy Application
*/
Morfy::factory()->run();
}