-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap.php
executable file
·53 lines (45 loc) · 1.43 KB
/
bootstrap.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
<?php
// Registered as dsc-admin (rather than admin)
// so that /:module/:controller/:action/:params can be defined as a global route
// without always routing to this module
$application->registerModules(array(
'phalcon-admin' => array(
'className' => 'Dsc\Admin\Module',
'path' => __dir__ . '/src/Module.php'
)
), true);
$di = $application->getDI();
switch ($di->get('APP_NAME'))
{
case "admin":
// set this as the theme
$di->get('theme')->setTheme('AdminTheme', PATH_ROOT . 'vendor/dioscouri/phalcon-admin/src/Theme/' );
$di->get('theme')->registerViewPath( PATH_ROOT . 'vendor/dioscouri/phalcon-admin/src/Views/', 'Admin/Views' );
$di->get('theme')->registerEngine(
array(
".php" => 'Phalcon\Mvc\View\Engine\Php'
)
);
$router = $di->get('router');
$router->mount( new \Dsc\Admin\Routes );
/**
* Custom authentication component
*/
$di->set('auth', function () {
return new \Dsc\Admin\Lib\Auth();
});
/**
* Mail service uses AmazonSES
*/
$di->set('mail', function () {
return new \Dsc\Admin\Lib\Mail();
});
/**
* Access Control List
*/
$di->set('acl', function () {
return new \Dsc\Admin\Lib\Acl();
});
break;
}
?>