-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
31 lines (25 loc) · 954 Bytes
/
index.php
File metadata and controls
31 lines (25 loc) · 954 Bytes
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
<?php
session_start();
define ('DS', DIRECTORY_SEPARATOR);
define ('HOME', dirname(__FILE__));
define ('DB_NAME', '');
define ('VIEWS_LAYOUT', HOME . DS . 'views' . DS . 'layout' . DS);
define ('PUBLIC_DIR', DS . 'public' . DS);
define ('DB_DIR', HOME . DS . 'database'. DS);
ini_set ('display_errors', 1);
spl_autoload_register(function ($class) {
if (file_exists(HOME . DS . 'libraries' . DS . strtolower($class) . '.php'))
{
require_once HOME . DS . 'libraries' . DS . strtolower($class) . '.php';
}
else if (file_exists(HOME . DS . 'models' . DS . strtolower($class) . '.php'))
{
require_once HOME . DS . 'models' . DS . strtolower($class) . '.php';
}
else if (file_exists(HOME . DS . 'controllers' . DS . strtolower($class) . '.php'))
{
require_once HOME . DS . 'controllers' . DS . strtolower($class) . '.php';
}
});
require_once HOME . DS . 'libraries' . DS . 'routing.php';
$App = new App();