-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.php
executable file
·42 lines (31 loc) · 1.09 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
<?php
class PusherBootstrap extends \Dsc\Bootstrap{
protected $dir = __DIR__;
protected $namespace = 'Pusher';
// dont do anything for admin
protected function preAdmin(){
$container = \Dsc\System::instance()->get('container');
$container->share( 'pusher', function() {
$settings = \Pusher\Models\Settings::fetch();
return new \Pusher\Pusher($settings->{'pusher.key'}, $settings->{'pusher.secret'}, $settings->{'pusher.app_id'});
} );
}
// dont do anything for admin
protected function preSite(){
$container = \Dsc\System::instance()->get('container');
$container->share( 'pusher', function() {
$settings = \Pusher\Models\Settings::fetch();
return new \Pusher\Pusher($settings->{'pusher.key'}, $settings->{'pusher.secret'}, $settings->{'pusher.app_id'});
} );
}
protected function runAdmin()
{
parent::runAdmin();
\Dsc\System::instance()->get('router')->mount( new \Pusher\Admin\Routes, $this->namespace );
}
protected function runSite()
{
parent::runSite();
}
}
$app = new PusherBootstrap();