Files
Testing/tbs/wp-content/plugins/ubermenu/standard/stylegenerator/StyleGenerator.class.php
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

34 lines
649 B
PHP

<?php
if( !class_exists( 'uber_lessc' ) ) require_once( 'lessc.inc.php' );
class StyleGenerator{
private $file;
private $less;
private $css;
function __construct( $file ){
if( is_null( $file ) ) return false;
$this->file = $file;
$this->less = new uber_lessc( $file );
}
function generateCSS( $settings ){
try {
$this->css = $this->less->parse( null , $settings );
} catch (Exception $ex) {
echo "lessphp fatal error: ".$ex->getMessage();
}
return $this->css;
}
function writeStylesheet( $filename , $prepend ){
$css = $prepend . $this->css;
return file_put_contents( $filename , $css );
}
}