diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2021-07-30 03:06:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 03:06:36 +0300 |
commit | af066cb6267258c660fe66c795d358d8ac91be0d (patch) | |
tree | 81d8089058a1b29b9a3e818dacd85cd05a44471b /plugins/ExamplePlugin | |
parent | da4df21e808fa983e32c6402c8f3de90145e0910 (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.php | 31 |
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; + } +} |