-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
executable file
·56 lines (46 loc) · 1.42 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
<?php
class AssetsBootstrap extends \Dsc\Bootstrap
{
protected $dir = __DIR__;
protected $namespace = 'Assets';
protected function preAdmin()
{
$this->checkSymlink();
}
protected function preSite()
{
$this->checkSymlink();
}
protected function checkSymlink()
{
if (!is_dir($this->app->get('PATH_ROOT') . 'public/Assets'))
{
$target = $this->app->get('PATH_ROOT') . 'public/Assets';
$source = realpath( $this->app->get('PATH_ROOT') . 'vendor/dioscouri/f3-assets/src/Assets/Assets' );
$res = symlink($source, $target);
}
}
protected function runAdmin()
{
if (class_exists('\Minify\Factory'))
{
\Minify\Factory::registerPath($this->dir . "/src/");
$files = array(
'Assets/Assets/fineuploader/all.fineuploader.js',
);
foreach ($files as $file)
{
\Minify\Factory::js($file);
}
$files = array(
'Assets/Assets/fineuploader/fineuploader.css',
);
foreach ($files as $file)
{
\Minify\Factory::css($file);
}
}
parent::runAdmin();
}
}
$app = new AssetsBootstrap();