forked from codenitive/laravel-hybrid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.php
46 lines (41 loc) · 1.53 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
<?php
/*
|--------------------------------------------------------------------------
| Hybrid Library
|--------------------------------------------------------------------------
|
| Map Hybrid Library using PSR-0 standard namespace.
*/
Autoloader::namespaces(array(
'Hybrid' => Bundle::path('hybrid').'libraries',
));
/*
|--------------------------------------------------------------------------
| Hybrid Exceptions
|--------------------------------------------------------------------------
|
| List of exceptions for Hybrid bundle.
*/
Autoloader::map(array(
'Hybrid\\AclException' => Bundle::path('hybrid').'libraries/exceptions'.EXT,
'Hybrid\\Exception' => Bundle::path('hybrid').'libraries/exceptions'.EXT,
'Hybrid\\InvalidArgumentException' => Bundle::path('hybrid').'libraries/exceptions'.EXT,
'Hybrid\\OutOfBoundsException' => Bundle::path('hybrid').'libraries/exceptions'.EXT,
'Hybrid\\RuntimeException' => Bundle::path('hybrid').'libraries/exceptions'.EXT,
));
/*
|--------------------------------------------------------------------------
| Hybrid Events Listener
|--------------------------------------------------------------------------
|
| Lets listen to when Hybrid bundle is started and `hybrid.auth.roles` event.
*/
Event::listen('laravel.started: hybrid', function () { Hybrid\Core::start(); });
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);
}
});