Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/AssetManager/UIAsset/OnDiskUIAsset.php')
-rw-r--r--core/AssetManager/UIAsset/OnDiskUIAsset.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/AssetManager/UIAsset/OnDiskUIAsset.php b/core/AssetManager/UIAsset/OnDiskUIAsset.php
index cbd702a691..48557480e0 100644
--- a/core/AssetManager/UIAsset/OnDiskUIAsset.php
+++ b/core/AssetManager/UIAsset/OnDiskUIAsset.php
@@ -10,6 +10,7 @@ namespace Piwik\AssetManager\UIAsset;
use Exception;
use Piwik\AssetManager\UIAsset;
+use Piwik\Common;
use Piwik\Filesystem;
class OnDiskUIAsset extends UIAsset
@@ -25,13 +26,26 @@ class OnDiskUIAsset extends UIAsset
private $relativeLocation;
/**
+ * @var string
+ */
+ private $relativeRootDir;
+
+ /**
* @param string $baseDirectory
* @param string $fileLocation
*/
- public function __construct($baseDirectory, $fileLocation)
+ public function __construct($baseDirectory, $fileLocation, $relativeRootDir = '')
{
$this->baseDirectory = $baseDirectory;
$this->relativeLocation = $fileLocation;
+
+ if (!empty($relativeRootDir)
+ && is_string($relativeRootDir)
+ && !Common::stringEndsWith($relativeRootDir, '/')) {
+ $relativeRootDir .= '/';
+ }
+
+ $this->relativeRootDir = $relativeRootDir;
}
public function getAbsoluteLocation()
@@ -41,6 +55,9 @@ class OnDiskUIAsset extends UIAsset
public function getRelativeLocation()
{
+ if (isset($this->relativeRootDir)) {
+ return $this->relativeRootDir . $this->relativeLocation;
+ }
return $this->relativeLocation;
}