diff options
author | Daniel <mail@danielkesselberg.de> | 2024-06-29 15:59:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-29 15:59:17 +0200 |
commit | 02983f331743542594ce51f57c419205a13a378a (patch) | |
tree | ef1461c9510f0b1a292c93fd55a9db74b28ff9cb /apps | |
parent | 700372578259e1cb384bd6f3910720db026f6a92 (diff) | |
parent | fd9fd1b6fb09c4a99de96f88068b81ced74e13ff (diff) | |
download | nextcloud-server-02983f331743542594ce51f57c419205a13a378a.tar.gz nextcloud-server-02983f331743542594ce51f57c419205a13a378a.zip |
Merge pull request #46190 from nextcloud/bug/45047/skip-check-when-disk-free-space-disabled
fix(setupchecks): skip check when disk_free_space is disabled
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/SetupChecks/TempSpaceAvailable.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/settings/lib/SetupChecks/TempSpaceAvailable.php b/apps/settings/lib/SetupChecks/TempSpaceAvailable.php index c369735bba6..ef51ffe0e07 100644 --- a/apps/settings/lib/SetupChecks/TempSpaceAvailable.php +++ b/apps/settings/lib/SetupChecks/TempSpaceAvailable.php @@ -67,7 +67,11 @@ class TempSpaceAvailable implements ISetupCheck { return SetupResult::error($this->l10n->t('Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: %s', [$phpTempPath])); } - $freeSpaceInTemp = function_exists('disk_free_space') ? disk_free_space($phpTempPath) : false; + if (!function_exists('disk_free_space')) { + return SetupResult::info($this->l10n->t('The PHP function "disk_free_space" is disabled, which prevents the check for enough space in the temporary directories.')); + } + + $freeSpaceInTemp = disk_free_space($phpTempPath); if ($freeSpaceInTemp === false) { return SetupResult::error($this->l10n->t('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: %s', [$phpTempPath])); } @@ -76,7 +80,7 @@ class TempSpaceAvailable implements ISetupCheck { $freeSpaceInTempInGB = $freeSpaceInTemp / 1024 / 1024 / 1024; $spaceDetail = $this->l10n->t('- %.1f GiB available in %s (PHP temporary directory)', [round($freeSpaceInTempInGB, 1),$phpTempPath]); if ($nextcloudTempPath !== $phpTempPath) { - $freeSpaceInNextcloudTemp = function_exists('disk_free_space') ? disk_free_space($nextcloudTempPath) : false; + $freeSpaceInNextcloudTemp = disk_free_space($nextcloudTempPath); if ($freeSpaceInNextcloudTemp === false) { return SetupResult::error($this->l10n->t('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: %s', [$nextcloudTempPath])); } |