aboutsummaryrefslogtreecommitdiffstats
path: root/public/admin/controller/startup/sass.php
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-08-18 21:14:58 -0500
committerJesús <heckyel@hyperbola.info>2019-08-18 21:14:58 -0500
commit2eed7b082f83630301e51f57ca8394de228a8605 (patch)
tree1d19962d22d30f99317d9276e4bae7744fc93fc2 /public/admin/controller/startup/sass.php
downloadlibrecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.lz
librecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.xz
librecart-2eed7b082f83630301e51f57ca8394de228a8605.zip
first commit
Diffstat (limited to 'public/admin/controller/startup/sass.php')
-rw-r--r--public/admin/controller/startup/sass.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/public/admin/controller/startup/sass.php b/public/admin/controller/startup/sass.php
new file mode 100644
index 0000000..9af89b3
--- /dev/null
+++ b/public/admin/controller/startup/sass.php
@@ -0,0 +1,27 @@
+<?php
+class ControllerStartupSass extends Controller {
+ public function index() {
+ $file = DIR_APPLICATION . 'view/stylesheet/bootstrap.css';
+
+ if (!is_file($file) || !$this->config->get('developer_sass')) {
+ include_once(DIR_STORAGE . 'vendor/scss.inc.php');
+
+ $scss = new Scssc();
+ $scss->setImportPaths(DIR_APPLICATION . 'view/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);
+ }
+ }
+}