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:
authorPeter Zhang <waikatozhang@gmail.com>2021-10-05 06:27:47 +0300
committerGitHub <noreply@github.com>2021-10-05 06:27:47 +0300
commit4196894e8f39771b252b1dfaa5a7c8f734d84bfb (patch)
treeaa4a14d3ab6df923653fc525b17f8ec04f389ba9
parentf48b6d52710bf25aeff0bf7724ecdd594ec6c3f1 (diff)
add php binary format check (#18060)
add PHP binary format check recommend 64 bit
-rw-r--r--plugins/Diagnostics/Diagnostic/PHPBinaryCheck.php45
-rw-r--r--plugins/Diagnostics/config/config.php1
-rw-r--r--plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png4
-rw-r--r--plugins/Installation/lang/en.json4
-rw-r--r--plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png4
5 files changed, 53 insertions, 5 deletions
diff --git a/plugins/Diagnostics/Diagnostic/PHPBinaryCheck.php b/plugins/Diagnostics/Diagnostic/PHPBinaryCheck.php
new file mode 100644
index 0000000000..502f6ef90c
--- /dev/null
+++ b/plugins/Diagnostics/Diagnostic/PHPBinaryCheck.php
@@ -0,0 +1,45 @@
+<?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\Diagnostics\Diagnostic;
+
+use Piwik\Translation\Translator;
+
+/**
+ * Check the PHP Binary is set to 64 bit
+ */
+class PHPBinaryCheck implements Diagnostic
+{
+ /**
+ * @var Translator
+ */
+ private $translator;
+
+ /**
+ * @var int
+ */
+
+ public function __construct(Translator $translator)
+ {
+ $this->translator = $translator;
+ }
+
+ public function execute()
+ {
+ $label = $this->translator->translate('Installation_PhpBinaryCheck');
+
+ if (PHP_INT_SIZE === 8) {
+ $status = DiagnosticResult::STATUS_OK;
+ $comment = "";
+ } else {
+ $status = DiagnosticResult::STATUS_WARNING;
+ $comment = $this->translator->translate('Installation_PhpBinaryCheckHelp');
+ }
+
+ return array(DiagnosticResult::singleResult($label, $status, $comment));
+ }
+}
diff --git a/plugins/Diagnostics/config/config.php b/plugins/Diagnostics/config/config.php
index 9209ac505e..2edd5f7bc2 100644
--- a/plugins/Diagnostics/config/config.php
+++ b/plugins/Diagnostics/config/config.php
@@ -20,6 +20,7 @@ return array(
DI\get(RequiredPrivateDirectories::class),
DI\get(RecommendedPrivateDirectories::class),
DI\get('Piwik\Plugins\Diagnostics\Diagnostic\FileIntegrityCheck'),
+ DI\get('Piwik\Plugins\Diagnostics\Diagnostic\PHPBinaryCheck'),
DI\get('Piwik\Plugins\Diagnostics\Diagnostic\TrackerCheck'),
DI\get('Piwik\Plugins\Diagnostics\Diagnostic\MemoryLimitCheck'),
DI\get('Piwik\Plugins\Diagnostics\Diagnostic\TimezoneCheck'),
diff --git a/plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png b/plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png
index d67421b809..0aabb52e85 100644
--- a/plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png
+++ b/plugins/Diagnostics/tests/UI/expected-screenshots/Diagnostics_page.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:471fa17bcda0562745eda811beddb7327527c2bb697a7a59e27f7fb4b50e8659
-size 464624
+oid sha256:3bd811ead76de5332d5c0fe6023e4adab18ebf4c4701b4931aef12cf0ffe4446
+size 466436
diff --git a/plugins/Installation/lang/en.json b/plugins/Installation/lang/en.json
index 02c7a9b10a..ac71e1d6d2 100644
--- a/plugins/Installation/lang/en.json
+++ b/plugins/Installation/lang/en.json
@@ -137,6 +137,8 @@
"SystemCheckPhpSetting": "To prevent some critical issue, you must set the following in your php.ini file: %s",
"SystemCheckUpdateHttps": "Update over HTTPS",
"SystemCheckUpdateHttpsNotSupported": "Matomo cannot use HTTPS to update, it will fall back to the insecure HTTP update. Check that CURL or allow_url_fopen is supported and that the openssl PHP extension is installed: https:\/\/matomo.org\/faq\/troubleshooting\/faq_177\/.",
+ "PhpBinaryCheck" : "64-bit PHP Binary",
+ "PhpBinaryCheckHelp": "32-bit <p> We recommend upgrading to a 64-bit PHP binary at the latest by January 2026 to prevent bugs in the future.</p>",
"NotSupported": "not supported",
"Tables": "Creating the Tables",
"TablesCreatedSuccess": "Tables created with success!",
@@ -158,4 +160,4 @@
"PerformanceSettingsDesc1": "One final note regarding performance: your Matomo is setup and ready to track and report on your website's traffic, but if you find Matomo slow, you will want to take the extra step of setting up %1$sCLI archiving%2$s. This will generate your reports in the background periodically, rather than on demand.",
"PerformanceSettingsDesc2": "This requires adding a Matomo command to cron which can't be done automatically by the installer, but you can %1$sread our FAQ to learn how you can set it up yourself.%2$s"
}
-} \ No newline at end of file
+}
diff --git a/plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png b/plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png
index 1a12421ecc..48f79a74bb 100644
--- a/plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png
+++ b/plugins/Installation/tests/UI/expected-screenshots/Installation_system_check.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:0fc783ae07f00e3cc8a782288eae50ec1120018690e2120927e855fed69841fc
-size 273637
+oid sha256:e49fa011f3ebaed6b77cdceb4a8b6b600a51985e01fe0381c1ab99dc289a6c88
+size 275880