/** * * @param type $variables * @param type $functions * @return \Leafo\ScssPhp\Server|boolean */ function get_scss_parser($variables, $functions) { if (!(include_once SCSSPHP_INC . 'scss.inc.php')) { trigger_error('Unable to process .scss file -- SCSSPHP not configured correctly on your server. Check the SCSSPHP_INC setting in settings/package_settings.php.'); return false; } $scss = new Leafo\ScssPhp\Compiler(); $scss->setFormatter('Leafo\\ScssPhp\\Formatter\\Compressed'); $scss->setVariables($variables); foreach ($functions as $name => $func) { $scss->registerFunction($name, $func); } return new \Leafo\ScssPhp\Server('.', '.', $scss); }