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:
Diffstat (limited to 'core/Plugin.php')
-rw-r--r--core/Plugin.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/Plugin.php b/core/Plugin.php
index 109592635a..4e1df7eba9 100644
--- a/core/Plugin.php
+++ b/core/Plugin.php
@@ -648,6 +648,28 @@ class Plugin
}
return $dependency;
}
+
+ /**
+ * Get all changes for this plugin
+ *
+ * @return array Array of changes
+ * [{"title":"abc","description":"xyz","linkName":"def","link":"https://link","version":"1.2.3"}]
+ */
+ public function getChanges()
+ {
+ $file = Manager::getPluginDirectory($this->pluginName).'/changes.json';
+ if (file_exists($file)) {
+ $json = file_get_contents($file);
+ if ($json) {
+ $changes = json_decode($json, true);
+ if ($changes && is_array($changes)) {
+ return array_reverse($changes);
+ }
+ }
+ }
+ return [];
+ }
+
}
}