mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +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
558f2103ef
commit
dc21bbb743
|
@ -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