-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
59 lines (50 loc) · 1.4 KB
/
index.php
File metadata and controls
59 lines (50 loc) · 1.4 KB
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
<?php
/**
* The CMS by CodeLiners - The Open Source Coding group
*
*/
define("COFLIGHT", true);
define("COFLIGHT_VER", "0.2.1");
define('DSEP', DIRECTORY_SEPARATOR);
define('RDIR', dirname(__FILE__).DSEP);
function startsWith($haystack, $needle)
{
return !strncmp($haystack, $needle, strlen($needle));
}
function endsWith($haystack, $needle)
{
$length = strlen($needle);
if ($length == 0) {
return true;
}
return (substr($haystack, -$length) === $needle);
}
require RDIR.'config.php';
global $cfg;
define("DB_PREF", $cfg['db']['tabprefix']);
require RDIR.'on.php';
$dir = dir(RDIR.'inc');
while ($d = $dir->read()) {
if ($d != '.' and $d != '..') {
include RDIR.'inc'.DSEP.$d;
}
}
try {
$c = new Coflight();
$dir = dir(RDIR.'inc_secondary');
while ($d = $dir->read()) {
if ($d != '.' and $d != '..') {
include RDIR.'inc_secondary'.DSEP.$d;
}
}
on::onInit();
$c->run();
} catch (Exception $ex) {
?>
<html><head><title>Err... what?</title></head><body>
<h1>Internal Error: <?php echo $ex->getMessage(); ?></h1>
<pre><?php echo $ex->getTraceAsString(); ?></pre>
</body></html>
<?php
}
?>