According to https://github.com/curl/curl/issues/12155 and 2d6333101a
Some corporate Windows proxy (mis)configurations don't pass along
intermediate certificates in their TLS handshakes, breaking lots of
things that don't work around it.
This creates a problem in our curl calls when checking for
.upgrade_requirements.json, and seems to be the source of errors for a
few of our users: https://github.com/snipe/snipe-it/issues/14826#issuecomment-2197611342
In this change, we detect when running on windows environments and load
the curl option that works around this.
Having a no-interactive flag is useful because attempting
to automate snipe-it upgrades is currently extremely janky.
You have to either:
a) read the prompts and pass in the input (the "correct" way)
b) pipe in input, e.g. `yes` and hope no new prompts
are added.
With the `no-interactive` flag, this can be fixed by both
allowing new prompts to be added without conflict
to user prompts, but also allowing automated upgrades (you could
choose to crash, or assign defaults).
In https://github.com/snipe/snipe-it/pull/14128 we added the capability
for the upgrade.php script to check version requirements _before_
downloading the new source, to help keep from breaking installations.
Turns out, `file_get_contents()` isn't a reliable way to grab a url, because
some systems have `allow_url_fopen` turned off in their PHP
configurations.
In this iteration, we swap that out for a curl function, while also
adding more error handling, the ability to entirely skip the
PHP version checks if for some reason you Just Can't query the upgrade
json correctly, as well as adding a lot of helpful text around the whole
issue.
Additionally, I've added some error checking around DB backups and
initial artisan down-ing, since shell_exec would happily march right
past any errors.
* Troubleshooting gd detection :(
* Welp, that didn’t work.
* Improvements to the update script that will make it easier to maintain
* Improved spacing
* Nicer intro
* Sorry for all the commits - I have to push in order to test :(
* More display improvements
* Phrasing!
* More formatting
* Removed extra line break
* Few more formatting changes
* Remove the config caching - it’s too confusing for users
* Added comments
* Temp required extension in the array so I can show output :)
* Added ascii x
* removed extra line break
* Made error message clearer
* Remove extra line
* Removed farts
* Changed phrasing for PHP upgrade warning
* Small tweaks per PR review
* Some spacing fixes
* Added confirmation of the either/ors
* Minor formatting tweaks
* Fixed weird indenting?
* Fixed missing $unused_file variable