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:
authorBen Burgess <88810029+bx80@users.noreply.github.com>2022-04-04 08:23:30 +0300
committerGitHub <noreply@github.com>2022-04-04 08:23:30 +0300
commit816fcd23472760fce0c4cfc17c5149419fd84463 (patch)
treee23ec3c8fcc676421c683bfaa7ea763d2a1c8ebb /plugins
parentb53e468fa6135b3f15afd92b41636d1782a5a478 (diff)
Improved PHP-FPM diagnostic check config option compatibility (#19031)
* Adjust PHP-FPM diagnostic check to respect enable_required_directories_diagnostic config setting * Updated UI test screenshots * Simplified warning message display logic, now using GeneralConfig::getConfigValue * Remove use * Update UI test screenshots Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Diagnostics/Diagnostic/PhpInformational.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/Diagnostics/Diagnostic/PhpInformational.php b/plugins/Diagnostics/Diagnostic/PhpInformational.php
index bbe5d0f847..44e784edd2 100644
--- a/plugins/Diagnostics/Diagnostic/PhpInformational.php
+++ b/plugins/Diagnostics/Diagnostic/PhpInformational.php
@@ -8,6 +8,7 @@
namespace Piwik\Plugins\Diagnostics\Diagnostic;
use Piwik\CliMulti\CliPhp;
+use Piwik\Config\GeneralConfig;
use Piwik\Date;
use Piwik\SettingsPiwik;
use Piwik\Translation\Translator;
@@ -38,17 +39,19 @@ class PhpInformational implements Diagnostic
$results[] = DiagnosticResult::informationalResult('PHP_BINARY', PHP_BINARY);
}
- // Check for php fpm and warn about access rules
-
$isGlobalConfigIniAccessible = true; // Assume true if not installed yet
-
- if (SettingsPiwik::isMatomoInstalled()) {
- $rpd = new RequiredPrivateDirectories($this->translator);
- $isGlobalConfigIniAccessible = $rpd->isGlobalConfigIniAccessible();
+ // Only attempt to check file accessibility if the config setting allows it
+ $disableFileAccessCheck = (GeneralConfig::getConfigValue('enable_required_directories_diagnostic') == 0);
+ if(!$disableFileAccessCheck) {
+ if (SettingsPiwik::isMatomoInstalled()) {
+ $rpd = new RequiredPrivateDirectories($this->translator);
+ $isGlobalConfigIniAccessible = $rpd->isGlobalConfigIniAccessible();
+ }
}
- if (strpos(strtolower(php_sapi_name()), 'fpm-fcgi') !== false && $isGlobalConfigIniAccessible) {
+ if (strpos(strtolower(php_sapi_name()), 'fpm-fcgi') !== false && $isGlobalConfigIniAccessible && !$disableFileAccessCheck) {
+ // Using PHP-FPM and private files are accessible
$comment = php_sapi_name()."<br><br>";
if (!empty($_SERVER['SERVER_SOFTWARE'])) {
@@ -64,7 +67,6 @@ class PhpInformational implements Diagnostic
} else {
$comment .= $this->translator->translate('Diagnostics_PHPFPMWarningGeneric');
}
-
$results[] = DiagnosticResult::singleResult('PHP SAPI', DiagnosticResult::STATUS_WARNING, $comment);
} else {
$results[] = DiagnosticResult::informationalResult('PHP SAPI', php_sapi_name());