sass.php (846B)
1 <?php 2 class ControllerStartupSass extends Controller { 3 public function index() { 4 $file = DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/bootstrap.css'; 5 6 if (!is_file($file) || (is_file(DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/sass/_bootstrap.scss') && !$this->config->get('developer_sass'))) { 7 include_once(DIR_STORAGE . 'vendor/scss.inc.php'); 8 9 $scss = new Scssc(); 10 $scss->setImportPaths(DIR_APPLICATION . 'view/theme/' . $this->config->get('theme_directory') . '/stylesheet/sass/'); 11 12 $output = $scss->compile('@import "_bootstrap.scss"'); 13 14 $handle = fopen($file, 'w'); 15 16 flock($handle, LOCK_EX); 17 18 fwrite($handle, $output); 19 20 fflush($handle); 21 22 flock($handle, LOCK_UN); 23 24 fclose($handle); 25 } 26 } 27 }