<?php

/**
 * Snippet to invoke the less compiler.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package clearFusionCMS\snippet\lessc
 * @copyright Copyright (c) 2014 clearFusionCMS. All rights reserved.
 * @link http://clearfusioncms.com
 */

if(isset($content)) {
	$less = new cfLessc();
	$less->setFormatter('compressed');
	$less->setImportDir(array(
		FLAPPPATH . 'lessphp/mixins/',
		FLAPPPATH . 'font-awesome/less/',
		FLMODPATH
	));

	try {
		echo $less->compile($content);
	} catch(Exception $e) {
		echo 'lessc fatal error: ' . $e->getMessage();
	}
}