Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix(setupchecks): skip check when disk_free_space is disabled #46223

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/settings/lib/SetupChecks/TempSpaceAvailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ public function run(): SetupResult {
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]));
}
Expand All @@ -93,7 +97,7 @@ public function run(): SetupResult {
$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]));
}
Expand Down
Loading