Load LESS variables via path traversal

Since these files are part of the same package, there is no need
to assume a Composer context to load these from. Instead, we can
just load them via the path relative to the current PHP file.

This assumption may break in certain environments, and it is
already broken when running (integration) tests.
This commit is contained in:
Franz Liedke 2019-06-04 23:47:29 +02:00
parent 836351f0cc
commit 77025c7bfd

View File

@ -72,8 +72,8 @@ class FrontendServiceProvider extends AbstractServiceProvider
public function addBaseCss(SourceCollector $sources)
{
$sources->addFile(base_path().'/vendor/flarum/core/less/common/variables.less');
$sources->addFile(base_path().'/vendor/flarum/core/less/common/mixins.less');
$sources->addFile(__DIR__.'/../../less/common/variables.less');
$sources->addFile(__DIR__.'/../../less/common/mixins.less');
$this->addLessVariables($sources);
}