leafo/lessphp — Issue #169: file_put_contents not allowed on server CURL workaround?
Author: jesserosenfield
Created: 2011-12-28 22:31:14+00:00
State: open

My .CSS file is not being output using *neither*

try {
lessc::ccompile('wp-content/themes/re/style.less', 'wp-content/themes/re/apl.css');
} catch (exception $ex) {
exit('lessc fatal error:
'.$ex->getMessage());
}

*nor*

$less_file = 'myfile.less';
$css_file = 'myfile.css';

// create a new cache object, and compile
$cache = lessc::cexecute('myfile.less');
file_put_contents($css_file, $cache['compiled']);

// the next time we run, write only if it has updated
$last_updated = $cache['updated'];
$cache = lessc::cexecute($cache);
if ($cache['updated'] > $last_updated) {
file_put_contents($css_file, $cache['compiled']);
}

My hosting company says they do not allow "file_put_contents" or "fopen" and that I need to use CURL. Is there a work around for this?