diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-03-15 01:24:36 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-03-15 01:24:36 +0300 |
commit | 6395855aa7f3813cc7f413a18d31505ea26ba32a (patch) | |
tree | 2a3157954dd3c29cc024bf7093df53b63be94dd6 /core/Updater.php | |
parent | d7c932710e690d87ea62c3ec94ae65fa5bd05b05 (diff) |
Support multiple plugin paths (#14051)
* do not hard code plugins directory
* remove method that is not needed for now
* use plugins directory in more places
* some work on supporting multiple plugin directories
* use more unique name
* couple fixes
* and another fix
* sort plugins
* adjust languagesmanager
* adjust more usages
* Update Manager.php
* adding a plugin to test
* more tests
* make sure plugin resources can be located in custom directory
* adding more tests
* rewrite image paths
* handle more cases
* add tests
* make sure to load plugin
* trying to fix test
* trying it this way
* load plugin
* fix ui test?
* testing if tests succeed this way
* another test
* load custom dir plugin
* load plugin in ui fixture
* change the update statement
* remove update script
* delete column
* fix ui test
* make it work for tests
* fix some tests
* Fix merge.
Diffstat (limited to 'core/Updater.php')
-rw-r--r-- | core/Updater.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/Updater.php b/core/Updater.php index 9af07459b2..85c52e309b 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -63,7 +63,13 @@ class Updater public function __construct($pathUpdateFileCore = null, $pathUpdateFilePlugins = null, Columns\Updater $columnsUpdater = null) { $this->pathUpdateFileCore = $pathUpdateFileCore ?: PIWIK_INCLUDE_PATH . '/core/Updates/'; - $this->pathUpdateFilePlugins = $pathUpdateFilePlugins ?: Manager::getPluginsDirectory() . '%s/Updates/'; + + if ($pathUpdateFilePlugins) { + $this->pathUpdateFilePlugins = $pathUpdateFilePlugins; + } else { + $this->pathUpdateFilePlugins = null; + } + $this->columnsUpdater = $columnsUpdater ?: new Columns\Updater(); self::$activeInstance = $this; @@ -345,7 +351,11 @@ class Updater } elseif (ColumnUpdater::isDimensionComponent($name)) { $componentsWithUpdateFile[$name][PIWIK_INCLUDE_PATH . '/core/Columns/Updater.php'] = $newVersion; } else { - $pathToUpdates = sprintf($this->pathUpdateFilePlugins, $name) . '*.php'; + if ($this->pathUpdateFilePlugins) { + $pathToUpdates = sprintf($this->pathUpdateFilePlugins, $name) . '*.php'; + } else { + $pathToUpdates = Manager::getPluginDirectory($name) . '/Updates/*.php'; + } } if (!empty($pathToUpdates)) { |