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.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/core/Plugin.php b/core/Plugin.php
index 9f18f37c42..de37b52611 100644
--- a/core/Plugin.php
+++ b/core/Plugin.php
@@ -514,6 +514,34 @@ class Plugin
}
/**
+ * @return Date|null
+ * @throws \Exception
+ */
+ public function getPluginLastActivationTime()
+ {
+ $optionName = Manager::LAST_PLUGIN_ACTIVATION_TIME_OPTION_PREFIX . $this->pluginName;
+ $time = Option::get($optionName);
+ if (empty($time)) {
+ return null;
+ }
+ return Date::factory($time);
+ }
+
+ /**
+ * @return Date|null
+ * @throws \Exception
+ */
+ public function getPluginLastDeactivationTime()
+ {
+ $optionName = Manager::LAST_PLUGIN_DEACTIVATION_TIME_OPTION_PREFIX . $this->pluginName;
+ $time = Option::get($optionName);
+ if (empty($time)) {
+ return null;
+ }
+ return Date::factory($time);
+ }
+
+ /**
* @param $directoryWithinPlugin
* @param $expectedSubclass
* @return array
@@ -583,5 +611,6 @@ class Plugin
return $dependency;
}
}
+
}