forked from overdatum/domain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.php
64 lines (56 loc) · 2.17 KB
/
start.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
<?php
// --------------------------------------------------------------
// Load helpers
// --------------------------------------------------------------
require __DIR__.DS.'helpers'.EXT;
// --------------------------------------------------------------
// Load bundles
// --------------------------------------------------------------
Bundle::start('layla_thirdparty_dbmanager');
Bundle::start('layla_thirdparty_bootsparks');
// --------------------------------------------------------------
// Load directories
// --------------------------------------------------------------
Autoloader::directories(array(
__DIR__.DS.'models',
));
// --------------------------------------------------------------
// Load namespaces
// --------------------------------------------------------------
Autoloader::namespaces(array(
'Layla\\Domain' => __DIR__.DS.'libraries',
));
// --------------------------------------------------------------
// Filters
// --------------------------------------------------------------
Route::filter('authority', function($resource)
{
$action = Request::$route->parameters['0'];
if(Authority::cannot($action, $resource))
{
return Response::make('', 401);
}
});
Route::filter('auth', function()
{
if (Auth::guest()) return Redirect::make('', 401);
});
// --------------------------------------------------------------
// Setting system tables
// --------------------------------------------------------------
DBManager::$hidden = Config::get('layla_domain::dbmanager.hidden');
// --------------------------------------------------------------
// Set Aliases
// --------------------------------------------------------------
Autoloader::alias('Layla\\Domain\\Model', 'Eloquent');
// --------------------------------------------------------------
// Load Routes
// --------------------------------------------------------------
require __DIR__.DS.'routes'.DS.'account'.EXT;
require __DIR__.DS.'routes'.DS.'dbmanager'.EXT;
require __DIR__.DS.'routes'.DS.'language'.EXT;
require __DIR__.DS.'routes'.DS.'layout'.EXT;
require __DIR__.DS.'routes'.DS.'media'.EXT;
require __DIR__.DS.'routes'.DS.'page'.EXT;
require __DIR__.DS.'routes'.DS.'role'.EXT;
require __DIR__.DS.'routes'.DS.'auth'.EXT;