Skip to content

Commit 73c696b

Browse files
committed
feat: update wikimedia/less.php from 4.x to 5.x
1 parent 62260f8 commit 73c696b

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
"symfony/postmark-mailer": "^7.0",
173173
"symfony/translation": "^7.0",
174174
"symfony/yaml": "^7.0",
175-
"wikimedia/less.php": "^4.1",
175+
"wikimedia/less.php": "^5.3",
176176
"plesk/ratchetphp": "v1.0.4"
177177
},
178178
"require-dev": {

framework/core/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"symfony/translation-contracts": "^2.5",
9292
"symfony/yaml": "^7.0",
9393
"flarum/json-api-server": "^0.1.0",
94-
"wikimedia/less.php": "^4.1"
94+
"wikimedia/less.php": "^5.3"
9595
},
9696
"require-dev": {
9797
"flarum/testing": "^2.0",

framework/core/src/Frontend/Compiler/LessCompiler.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ protected function compile(array $sources): string
7474
unset($sources['custom_less']);
7575
}
7676

77+
$importDirs = $this->importDirs;
78+
if ($this->lessImportOverrides) {
79+
$importDirs[] = $this->overrideImports($sources);
80+
}
81+
7782
$maxNestingLevel = ini_get('xdebug.max_nesting_level');
7883

7984
ini_set('xdebug.max_nesting_level', '200');
@@ -83,15 +88,9 @@ protected function compile(array $sources): string
8388
'compress' => true,
8489
'strictMath' => false,
8590
'cache_dir' => $this->cacheDir,
86-
'import_dirs' => $this->importDirs,
91+
'import_dirs' => $importDirs,
8792
]);
8893

89-
if ($this->lessImportOverrides) {
90-
$parser->SetImportDirs([
91-
'' => $this->overrideImports($sources)
92-
]);
93-
}
94-
9594
if ($this->fileSourceOverrides) {
9695
$sources = $this->overrideSources($sources);
9796
}
@@ -173,7 +172,9 @@ private function overrideImports(array $sources): callable
173172
];
174173
})->unique('path');
175174

175+
var_dump(__METHOD__);
176176
return function (string $path) use ($baseSources): ?array {
177+
var_dump(__METHOD__, $path);
177178
$relativeImportPath = Str::of($path)->split('/\/less\//');
178179
$extensionId = $baseSources->where('path', $relativeImportPath->first())->pluck('extensionId')->first();
179180

0 commit comments

Comments
 (0)