-
Notifications
You must be signed in to change notification settings - Fork 4
/
start.php
67 lines (58 loc) · 1.99 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
65
66
67
<?php
/*
|--------------------------------------------------------------------------
| Hybrid Library
|--------------------------------------------------------------------------
|
| Map Hybrid Library using PSR-0 standard namespace.
|
*/
Autoloader::namespaces(array(
'Hybrid' => Bundle::path('hybrid').'libraries'.DS,
));
/*
|--------------------------------------------------------------------------
| Hybrid Exceptions
|--------------------------------------------------------------------------
|
| List of exceptions for Hybrid bundle.
|
*/
Autoloader::map(array(
'Hybrid\AclException' => Bundle::path('hybrid').'libraries'.DS.'exceptions'.EXT,
'Hybrid\Exception' => Bundle::path('hybrid').'libraries'.DS.'exceptions'.EXT,
'Hybrid\InvalidArgumentException' => Bundle::path('hybrid').'libraries'.DS.'exceptions'.EXT,
'Hybrid\OutOfBoundsException' => Bundle::path('hybrid').'libraries'.DS.'exceptions'.EXT,
'Hybrid\RuntimeException' => Bundle::path('hybrid').'libraries'.DS.'exceptions'.EXT,
'Hybrid\FTP\RuntimeException' => Bundle::path('hybrid').'libraries'.DS.'ftp'.DS.'exceptions'.EXT,
'Hybrid\FTP\ServerException' => Bundle::path('hybrid').'libraries'.DS.'ftp'.DS.'exceptions'.EXT,
));
/*
|--------------------------------------------------------------------------
| Hybrid Events Listener
|--------------------------------------------------------------------------
|
| Lets listen for `hybrid.auth.roles` event.
|
*/
Event::listen('hybrid.auth.roles', function ($user, $roles)
{
$callback = Config::get('hybrid::auth.roles');
if (is_callable($callback))
{
return call_user_func($callback, $user, $roles);
}
});
/*
|--------------------------------------------------------------------------
| Hybrid IoC
|--------------------------------------------------------------------------
|
| Add IoC for request to View, allow other bundle to implement alternative
| template option.
|
*/
IoC::register('hybrid.view', function($view)
{
return View::make($view);
});