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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2014-11-13 05:15:51 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2014-11-13 05:30:34 +0300
commitc9d698f4fb8f9ed683bc737b7991edb3793fa498 (patch)
treefbacb0525496ea3505f144c876f65338e80ce1bc /core/Profiler.php
parentc831518f45f2e75dce59639e7a2a10a90a830c91 (diff)
Moved the `tmp/` path into the config (was hardcoded everywhere)
The `tmp/` path was hardcoded everywhere, which resulted in using `SettingsPiwik::rewriteTmpPathWithInstanceId()` to rewrite it for specific use cases. I've moved that path into the config, and replaced all hardcoded usage (and calls to `rewriteTmpPathWithInstanceId()`) by a `get()` from the container. Getting entries from the container is a bad practice and dependency injection should be preferred, but we do baby steps. When refactoring those classes to DI, we'll replace calls to the container with proper dependency injection. Another thing we'll need to do too is move the hardcoded *sub-path* of `tmp/` (e.g. `tmp/sessions/`) into the config also (but again: baby steps). Another future step would be to remove completely instance ID and let it be handled by a plugin (or by end-user config). Having the `tmp/` path in the config means that plugins or users can override it and know it will be taken into account everywhere in Piwik.
Diffstat (limited to 'core/Profiler.php')
-rw-r--r--core/Profiler.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/Profiler.php b/core/Profiler.php
index 2b92583d89..45af8df6fa 100644
--- a/core/Profiler.php
+++ b/core/Profiler.php
@@ -9,6 +9,7 @@
namespace Piwik;
use Exception;
+use Piwik\Container\StaticContainer;
use XHProfRuns_Default;
/**
@@ -337,6 +338,6 @@ class Profiler
*/
private static function getPathToXHProfRunIds()
{
- return PIWIK_INCLUDE_PATH . '/tmp/cache/tests-xhprof-runs';
+ return StaticContainer::getContainer()->get('path.tmp') . '/cache/tests-xhprof-runs';
}
}