shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

sass.php (619B)


      1 <?php
      2 class ControllerStartupSass extends Controller {
      3 	public function index() {
      4 		$file = DIR_APPLICATION . 'view/stylesheet/bootstrap.css';
      5 
      6 		if (!is_file($file) || !$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/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 }