blob: 2e0fb36efba7f579827c4c7f5a13e30359245144 (
plain)
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
|
<?php
class ControllerStartupSass extends Controller {
public function index() {
$file = DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/bootstrap.css';
if (!is_file($file) || (is_file(DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/sass/_bootstrap.scss') && !$this->config->get('developer_sass'))) {
include_once(DIR_STORAGE . 'vendor/scss.inc.php');
$scss = new Scssc();
$scss->setImportPaths(DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/sass/');
$output = $scss->compile('@import "_bootstrap.scss"');
$handle = fopen($file, 'w');
flock($handle, LOCK_EX);
fwrite($handle, $output);
fflush($handle);
flock($handle, LOCK_UN);
fclose($handle);
}
}
}
|