Finish implementing localPath in combineToFile (#3727)

Fixes #3721. Credit to @Rike-cz
This commit is contained in:
Rike-cz 2018-09-23 22:38:59 +02:00 committed by Luke Towers
parent cf8a73f0a2
commit a03a76ee52
1 changed files with 11 additions and 0 deletions

View File

@ -205,6 +205,17 @@ class CombineAssets
// Disable cache always
$this->storagePath = null;
// Prefix all assets
if ($localPath) {
if (substr($localPath, -1) !== '/') {
$localPath = $localPath.'/';
}
$assets = array_map(function($asset) use ($localPath) {
if (substr($asset, 0, 1) === '@') return $asset;
return $localPath.$asset;
}, $assets);
}
list($assets, $extension) = $this->prepareAssets($assets);
$rewritePath = File::localToPublic(dirname($destination));