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

Preflight fails if getFreeDiskSpace returns false #3972

Closed
ssssct opened this issue Jan 3, 2024 · 0 comments · Fixed by #4097
Closed

Preflight fails if getFreeDiskSpace returns false #3972

ssssct opened this issue Jan 3, 2024 · 0 comments · Fixed by #4097

Comments

@ssssct
Copy link

ssssct commented Jan 3, 2024

Description of the problem

When you update EE6, the process will stop on preflight if it can’t figure out the available disk space. On shared hosting the available disk space can be hidden so the disk_free_space($path) PHP function will return FALSE preventing the live update to run even if it could.

getFreeDiskSpace() in Filesystem.php, is using disk_free_space($path) which can either return a float or FALSE, but in checkDiskSpace() in Preflight.php the returned value is treated as a number so if it gets FALSE, it fails assuming there is 0 available disk space.

Environment Details:

  • Version: 6.x
  • PHP Version any

Possible Solution

system/ee/ExpressionEngine/Service/Updater/Downloader/Preflight.php

Line 94
if ($free_space < 52428800) {

This line should take into account that $free_space can be FALSE
Maybe just warn or prompt the user to decide if he wants to proceed anyway?

intoeetive added a commit that referenced this issue Feb 29, 2024
…rvers with `disk_free_space()` disabled

Also resolves #3549
bryannielsen added a commit that referenced this issue Mar 18, 2024
…space

Resolved #3972 where it was not possible to use 1-click Updater on servers with `disk_free_space()` disabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant