Fix detection of whether or not an asset file is "empty"

We can't rely on files/strings for this, since the Locale JsCompiler doesn't use either, but still has content.
This commit is contained in:
Toby Zerner 2016-05-27 12:20:14 +09:30
parent 558f2103ef
commit dc21bbb743
2 changed files with 6 additions and 2 deletions

View File

@ -38,6 +38,10 @@ class LessCompiler extends RevisionCompiler
*/ */
public function compile() public function compile()
{ {
if (! count($this->files) || ! count($this->strings)) {
return;
}
ini_set('xdebug.max_nesting_level', 200); ini_set('xdebug.max_nesting_level', 200);
$parser = new Less_Parser([ $parser = new Less_Parser([

View File

@ -92,10 +92,10 @@ class RevisionCompiler implements CompilerInterface
$file = $this->path.'/'.substr_replace($this->filename, '-'.$current, -strlen($ext) - 1, 0); $file = $this->path.'/'.substr_replace($this->filename, '-'.$current, -strlen($ext) - 1, 0);
if ($this->files || $this->strings) { if ($content = $this->compile()) {
$this->putRevision($current); $this->putRevision($current);
file_put_contents($file, $this->compile()); file_put_contents($file, $content);
} else { } else {
return; return;
} }