/
bootstrap.php
84 lines (66 loc) · 2.28 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
class SupportBootstrap extends \Dsc\Bootstrap
{
protected $dir = __DIR__;
protected $namespace = 'Support';
protected function preSite()
{
parent::preSite();
$settings = \Support\Models\Settings::fetch();
if (class_exists('\Minify\Factory'))
{
\Minify\Factory::registerPath($this->dir . "/src/");
$files = array();
if ($settings->live_chat_enabled)
{
$files[] = 'Support/Assets/js/poller.js';
$files[] = 'Support/Assets/js/site.js';
}
foreach ($files as $file)
{
\Minify\Factory::js($file);
}
$files = array(
'Support/Assets/css/site.css',
);
foreach ($files as $file)
{
\Minify\Factory::css($file);
}
}
\Support\Models\ChatSessions::throttledCleanup();
}
protected function preAdmin()
{
parent::preAdmin();
if (class_exists('\Minify\Factory'))
{
\Minify\Factory::registerPath($this->dir . "/src/");
$files = array(
'Support/Assets/js/poller.js',
'Support/Assets/js/admin.js',
);
foreach ($files as $file)
{
\Minify\Factory::js($file);
}
$files = array(
'Support/Assets/css/admin.css',
);
foreach ($files as $file)
{
\Minify\Factory::css($file);
}
}
if ($op = \Support\Models\Operators::isOnline( $this->auth->getIdentity() ))
{
if (\Dsc\System::instance()->get('input')->get('ping', null, 'int') != 1)
{
$op->markActive();
}
}
\Dsc\System::instance()->getDispatcher()->addListener(\Support\Listeners\Users::instance());
\Support\Models\ChatSessions::throttledCleanup();
}
}
$app = new SupportBootstrap();