diff options
author | Matthieu Aubry <matt@piwik.org> | 2014-12-02 03:34:25 +0300 |
---|---|---|
committer | Matthieu Aubry <matt@piwik.org> | 2014-12-02 03:34:25 +0300 |
commit | a0d3bf94837642edafda458546497d703843854b (patch) | |
tree | ae558a78dc7488c3fc229889ac403ba757dce3e6 /config | |
parent | 03165a76526de6b537f64c5953e927b50a0ab18a (diff) | |
parent | 4a2145a1a7fd21cefb7d79e83f3416027c251c0a (diff) |
Merge pull request #6658 from piwik/tmp-path
Moved the `tmp/` path into the config (was hardcoded everywhere)
Diffstat (limited to 'config')
-rw-r--r-- | config/global.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/config/global.php b/config/global.php index 9a25907242..7dc6daa18f 100644 --- a/config/global.php +++ b/config/global.php @@ -1,4 +1,23 @@ <?php +use Interop\Container\ContainerInterface; + return array( + + 'path.root' => PIWIK_USER_PATH, + + 'path.tmp' => DI\factory(function (ContainerInterface $c) { + $root = $c->get('path.root'); + + // TODO remove that special case and instead have plugins override 'path.tmp' to add the instance id + if ($c->has('old_config.General.instance_id')) { + $instanceId = $c->get('old_config.General.instance_id'); + $instanceId = $instanceId ? '/' . $instanceId : ''; + } else { + $instanceId = ''; + } + + return $root . '/tmp' . $instanceId; + }), + ); |