diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2017-05-15 08:01:58 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-05-15 08:01:58 +0300 |
commit | b18fb8241ed64e7d7adf30993f6e954351452ec5 (patch) | |
tree | 0f6caee720819dba0b64d48c14ee1aa5a9cb1a57 /core/Plugin/MetadataLoader.php | |
parent | 210655cc0bb01edc88511087751bc0c6c471a58b (diff) |
Make sure plugins in config.ini.php are sorted depending on dependencies (#11683)
* fix #11681 make sure plugins in config.ini.php are sorted depending on dependencies
* added comment
* add missing tests
Diffstat (limited to 'core/Plugin/MetadataLoader.php')
-rw-r--r-- | core/Plugin/MetadataLoader.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/core/Plugin/MetadataLoader.php b/core/Plugin/MetadataLoader.php index bde849ff7e..b3d552cf80 100644 --- a/core/Plugin/MetadataLoader.php +++ b/core/Plugin/MetadataLoader.php @@ -11,6 +11,7 @@ namespace Piwik\Plugin; use Exception; use Piwik\Piwik; use Piwik\Version; +use Piwik\Plugin; /** * @see core/Version.php @@ -90,12 +91,22 @@ class MetadataLoader ); } - private function loadPluginInfoJson() + /** + * It is important that this method works without using anything from DI + * @return array|mixed + */ + public function loadPluginInfoJson() { - $path = $this->getPathToPluginFolder() . '/' . self::PLUGIN_JSON_FILENAME; + $path = $this->getPathToPluginJson(); return $this->loadJsonMetadata($path); } + public function getPathToPluginJson() + { + $path = $this->getPathToPluginFolder() . '/' . self::PLUGIN_JSON_FILENAME; + return $path; + } + private function loadJsonMetadata($path) { if (!file_exists($path)) { |