setImportPaths(dirname($file)."/"); $scss->setFormatter('scss_formatter_compressed'); // scss_formatter, scss_formatter_nested, scss_formatter_compressed try { $scssContent = $scss->compile('@import "'.$fileName.'"'); $fh = fopen(substr($file, 0, -$fileNameExtPos)."css", 'w'); fwrite($fh, $scssContent); fclose($fh); } catch (Exception $e) { echo ";top.ICEcoder.message('Couldn\'t compile your Sass, error info below:\\n\\n".$e->getMessage()."');"; } } // LESS Compiling if we have LESSPHP plugin installed if (strtolower($fileExt) == "less" && file_exists(dirname(__FILE__)."/../plugins/lessphp/lessc.inc.php")) { // Load the LESSPHP lib and start a new instance require dirname(__FILE__)."/../plugins/lessphp/lessc.inc.php"; $less = new lessc(); // Set the formatting type and if we want to preserve comments $less->setFormatter('lessjs'); // lessjs (same style used in LESS for JS), compressed (no whitespace) or classic (LESSPHP's original formatting) $less->setPreserveComments(false); // true or false try { $less->checkedCompile($file, substr($file, 0, -$fileNameExtPos)."css"); // Note: Only recompiles if changed } catch (Exception $e) { echo ";top.ICEcoder.message('Couldn\'t compile your LESS, error info below:\\n\\n".$e->getMessage()."');"; } } ?>