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 Aubry <matt@piwik.org>2014-12-02 03:34:25 +0300
committerMatthieu Aubry <matt@piwik.org>2014-12-02 03:34:25 +0300
commita0d3bf94837642edafda458546497d703843854b (patch)
treeae558a78dc7488c3fc229889ac403ba757dce3e6 /plugins/CorePluginsAdmin
parent03165a76526de6b537f64c5953e927b50a0ab18a (diff)
parent4a2145a1a7fd21cefb7d79e83f3416027c251c0a (diff)
Merge pull request #6658 from piwik/tmp-path
Moved the `tmp/` path into the config (was hardcoded everywhere)
Diffstat (limited to 'plugins/CorePluginsAdmin')
-rw-r--r--plugins/CorePluginsAdmin/PluginInstaller.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/plugins/CorePluginsAdmin/PluginInstaller.php b/plugins/CorePluginsAdmin/PluginInstaller.php
index 84b254e86e..e95f7f1d74 100644
--- a/plugins/CorePluginsAdmin/PluginInstaller.php
+++ b/plugins/CorePluginsAdmin/PluginInstaller.php
@@ -8,11 +8,11 @@
*/
namespace Piwik\Plugins\CorePluginsAdmin;
+use Piwik\Container\StaticContainer;
use Piwik\Filechecks;
use Piwik\Filesystem;
use Piwik\Piwik;
use Piwik\Plugin\Dependency as PluginDependency;
-use Piwik\SettingsPiwik;
use Piwik\Unzip;
/**
@@ -20,7 +20,7 @@ use Piwik\Unzip;
*/
class PluginInstaller
{
- const PATH_TO_DOWNLOAD = '/tmp/latest/plugins/';
+ const PATH_TO_DOWNLOAD = '/latest/plugins/';
const PATH_TO_EXTRACT = '/plugins/';
private $pluginName;
@@ -32,11 +32,10 @@ class PluginInstaller
public function installOrUpdatePluginFromMarketplace()
{
- $tmpPluginZip = PIWIK_USER_PATH . self::PATH_TO_DOWNLOAD . $this->pluginName . '.zip';
- $tmpPluginFolder = PIWIK_USER_PATH . self::PATH_TO_DOWNLOAD . $this->pluginName;
+ $tmpPluginPath = StaticContainer::getContainer()->get('path.tmp') . '/latest/plugins/';
- $tmpPluginZip = SettingsPiwik::rewriteTmpPathWithInstanceId($tmpPluginZip);
- $tmpPluginFolder = SettingsPiwik::rewriteTmpPathWithInstanceId($tmpPluginFolder);
+ $tmpPluginZip = $tmpPluginPath . $this->pluginName . '.zip';
+ $tmpPluginFolder = $tmpPluginPath . $this->pluginName;
try {
$this->makeSureFoldersAreWritable();
@@ -64,8 +63,7 @@ class PluginInstaller
public function installOrUpdatePluginFromFile($pathToZip)
{
- $tmpPluginFolder = PIWIK_USER_PATH . self::PATH_TO_DOWNLOAD . $this->pluginName;
- $tmpPluginFolder = SettingsPiwik::rewriteTmpPathWithInstanceId($tmpPluginFolder);
+ $tmpPluginFolder = StaticContainer::getContainer()->get('path.tmp') . self::PATH_TO_DOWNLOAD . $this->pluginName;
try {
$this->makeSureFoldersAreWritable();
@@ -98,7 +96,10 @@ class PluginInstaller
private function makeSureFoldersAreWritable()
{
- Filechecks::dieIfDirectoriesNotWritable(array(self::PATH_TO_DOWNLOAD, self::PATH_TO_EXTRACT));
+ Filechecks::dieIfDirectoriesNotWritable(array(
+ StaticContainer::getContainer()->get('path.tmp') . self::PATH_TO_DOWNLOAD,
+ self::PATH_TO_EXTRACT
+ ));
}
private function downloadPluginFromMarketplace($pluginZipTargetFile)