Skip to content

Commit 57d41e4

Browse files
Merge pull request #46223 from nextcloud/backport/46190/stable28
[stable28] fix(setupchecks): skip check when disk_free_space is disabled
2 parents b15af13 + 0353424 commit 57d41e4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/settings/lib/SetupChecks/TempSpaceAvailable.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ public function run(): SetupResult {
8484
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]));
8585
}
8686

87-
$freeSpaceInTemp = function_exists('disk_free_space') ? disk_free_space($phpTempPath) : false;
87+
if (!function_exists('disk_free_space')) {
88+
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.'));
89+
}
90+
91+
$freeSpaceInTemp = disk_free_space($phpTempPath);
8892
if ($freeSpaceInTemp === false) {
8993
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]));
9094
}
@@ -93,7 +97,7 @@ public function run(): SetupResult {
9397
$freeSpaceInTempInGB = $freeSpaceInTemp / 1024 / 1024 / 1024;
9498
$spaceDetail = $this->l10n->t('- %.1f GiB available in %s (PHP temporary directory)', [round($freeSpaceInTempInGB, 1),$phpTempPath]);
9599
if ($nextcloudTempPath !== $phpTempPath) {
96-
$freeSpaceInNextcloudTemp = function_exists('disk_free_space') ? disk_free_space($nextcloudTempPath) : false;
100+
$freeSpaceInNextcloudTemp = disk_free_space($nextcloudTempPath);
97101
if ($freeSpaceInNextcloudTemp === false) {
98102
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]));
99103
}

0 commit comments

Comments
 (0)