lessphp
lessphp copied to clipboard
Lessify broken in latest version
Seems like lessify is non-functional in the latest version because the isBlock method was removed from the lessc class.
I used the initial version to convert the jQuery UI base theme to LESS. Thanks for this!
I added a -a parameter to compile all .css to .less files if anyone's interested.
#!/usr/bin/php -q
<?php
if(php_sapi_name() !== "cli") {
err($fa.$argv[0]." must be run in the command line.");
exit(1);
}
$exe = array_shift($argv); // remove filename
if(!$filename = array_shift($argv)) {
exit("Usage: ".$exe." input-file\n");
}
require "lessify.inc.php";
function convert_file($css_filename) {
$less_filename = implode('.', explode('.', $css_filename, -1)) . '.less';
$parser = new lessify($css_filename);
ob_start();
$parser->parse();
$data = ob_get_contents();
ob_end_clean();
file_put_contents($less_filename, $data);
}
try {
if($filename === '-a') {
$filenames = glob('./*.css');
foreach($filenames as $filename) {
convert_file($filename);
}
}
else {
convert_file($filename);
}
}
catch(exception $e) {
exit("Fatal error: " . $e->getMessage() . "\n");
}
Yes it is definitely broken. The tree format changed significantly with the latest updates. I'll leave the online version functional though: http://leafo.net/lessphp/lessify/
I don't know when I'll get around to updating lessify to work against then new parser.
OK so lessify is still totally broken right?
$ [git:master?] ~/src/lessphp.git/lessify --help
PHP Strict Standards: Declaration of lessify::parse() should be compatible with lessc::parse($str = NULL, $initialVariables = NULL) in /home/markitek/src/lessphp.git/lessify.inc.php on line 361
Strict Standards: Declaration of lessify::parse() should be compatible with lessc::parse($str = NULL, $initialVariables = NULL) in /home/markitek/src/lessphp.git/lessify.inc.php on line 361
PHP Fatal error: Call to undefined method lessify::prepareParser() in /home/markitek/src/lessphp.git/lessify.inc.php on line 367
Fatal error: Call to undefined method lessify::prepareParser() in /home/markitek/src/lessphp.git/lessify.inc.php on line 367