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:
authorThomas Steur <tsteur@users.noreply.github.com>2021-07-30 03:06:36 +0300
committerGitHub <noreply@github.com>2021-07-30 03:06:36 +0300
commitaf066cb6267258c660fe66c795d358d8ac91be0d (patch)
tree81d8089058a1b29b9a3e818dacd85cd05a44471b /plugins/ExamplePlugin
parentda4df21e808fa983e32c6402c8f3de90145e0910 (diff)
Add command to generate a system check (#17832)
* Add command to generate a system check * Update plugins/CoreConsole/Commands/GenerateSystemCheck.php Co-authored-by: Stefan Giehl <stefan@matomo.org> * fix sprintf Co-authored-by: Stefan Giehl <stefan@matomo.org> Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
Diffstat (limited to 'plugins/ExamplePlugin')
-rw-r--r--plugins/ExamplePlugin/Diagnostic/ExampleCheck.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/ExamplePlugin/Diagnostic/ExampleCheck.php b/plugins/ExamplePlugin/Diagnostic/ExampleCheck.php
new file mode 100644
index 0000000000..147c2fe55b
--- /dev/null
+++ b/plugins/ExamplePlugin/Diagnostic/ExampleCheck.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\ExamplePlugin\Diagnostic;
+
+use Piwik\Plugins\Diagnostics\Diagnostic\Diagnostic;
+use Piwik\Plugins\Diagnostics\Diagnostic\DiagnosticResult;
+
+class ExampleCheck implements Diagnostic
+{
+ public function execute()
+ {
+ $result = [];
+
+ $label = 'Example Check';
+ $status = DiagnosticResult::STATUS_OK; // can be ok, error, warning or informational
+ $comment = 'A comment for this check';
+ $result[] = DiagnosticResult::singleResult($label, $status, $comment);
+
+ $label = 'Example Information';
+ $comment = 'The PHP version is ' . PHP_VERSION;
+ $result[] = DiagnosticResult::informationalResult($label, $status, $comment);
+
+ return $result;
+ }
+}