-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·38 lines (27 loc) · 1.01 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
<?php
include 'library/setting.php';
Autoloader::setCacheFilePath(APP_SYSPATH . APP_PATH . DS . 'cache/cache.txt');
Autoloader::setClassPaths(array(
APP_SYSPATH . APP_PATH . DS . 'controllers/',
APP_SYSPATH . APP_PATH . DS . 'models/',
APP_SYSPATH . APP_LIB . DS . 'core/',
APP_SYSPATH . APP_LIB . DS . 'db/',
APP_SYSPATH . APP_LIB . DS . 'helper/',
));
Autoloader::register();
// declare registry object
$registry = new MaleoRegistry();
// load the request
$registry->request = new MaleoRequest($registry);
// database registry object
$registry->db = MaleoDatabaseFactory::dbInit(ADAPTER_TYPE, array(DB_CONNECTION, DB_USR, DB_PWD));
// load up the view
$registry->view = new MaleoView($registry);
// set the view path
$registry->view->setPath(APP_SYSPATH . APP_PATH . DS . 'views');
// load the router
$registry->router = new MaleoRouter($registry);
// set the controller path
$registry->router->setPath(APP_SYSPATH . APP_PATH . DS . 'controllers');
// load the controller
$registry->router->loader();