Fixed #15190 - Improvements to upgrade.php script to improve Windows experience #15359
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is not a complete fix for all of the problems listed in that issue, but it should handle several of the use-cases.
file_get_contents()
first, which can provide a better experience on Windows. But ifallow_url_fopen
is disabled, we fall back to usingcurl
. Thiscurl
command might not work in Windows environments unless a CA bundle has been installed, typically this is done by installing OpenSSL.curl
on Windows, for some versions of PHP, will have these constants pre-defined.{}
) if all of the version requirements JSON-fetching fails, so the JSON parsing will still work - especially useful if you're using--skip-php-compatibility-checks
..env
file; this fixes that.We discussed the possibility of moving the backup part after the composer install part, but that's not going to make a difference - we also run
php artisan down
which would also fail if the current install is not properlycomposer install
'ed. So I left it as-is. I'm OK with the idea of either making these failures less 'hard' or possibly introducing new command-line options to better handle a semi-donked Snipe-IT install. But I suspect we should do that in a separate PR.