From f42142979dfdfa8f3fd7b1c28a2c876cb415f27d Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 4 Jun 2019 23:47:29 +0200 Subject: [PATCH] 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. --- src/Frontend/FrontendServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Frontend/FrontendServiceProvider.php b/src/Frontend/FrontendServiceProvider.php index 73d0c7a7d..efae2c933 100644 --- a/src/Frontend/FrontendServiceProvider.php +++ b/src/Frontend/FrontendServiceProvider.php @@ -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); }