mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
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:
parent
0b0c1055d6
commit
96eda5cfeb
|
@ -38,6 +38,10 @@ class LessCompiler extends RevisionCompiler
|
|||
*/
|
||||
public function compile()
|
||||
{
|
||||
if (! count($this->files) || ! count($this->strings)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ini_set('xdebug.max_nesting_level', 200);
|
||||
|
||||
$parser = new Less_Parser([
|
||||
|
|
|
@ -92,10 +92,10 @@ class RevisionCompiler implements CompilerInterface
|
|||
|
||||
$file = $this->path.'/'.substr_replace($this->filename, '-'.$current, -strlen($ext) - 1, 0);
|
||||
|
||||
if ($this->files || $this->strings) {
|
||||
if ($content = $this->compile()) {
|
||||
$this->putRevision($current);
|
||||
|
||||
file_put_contents($file, $this->compile());
|
||||
file_put_contents($file, $content);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user