This is much faster than checking the actual driver, which might take
a while if you have many sites. If we're just checking the actual
composer file (which is already parsed) this should be much faster.
This means that the user cannot tell we swapped out the view for another
view. The services are re-fetched upon creating the new view, but there
is a slight delay. This change conveniently "hides" this delay.
BEFORE
- Upon creating ServicesView2, ServicesView is deinitialized
- ServicesView2 shows question marks (no services data persisted)
- ServicesView2 async loads services, when done question marks removed
AFTER
- Upon creating ServicesView2, ServicesView is deinitialized
- ServicesView2 loads stale data (services data was persisted)
- ServicesView2 async loads services, when done stale data replaced
The version constraint checks will also be used in the future to
evaluate whether any given site's PHP constraint (if set) is
valid for the currently linked version of PHP.
For example, assuming you have PHP 8.1.2 linked, we could evaluate:
* A site requires "8.0" -> invalid
* A site requires "^8.0" -> valid
* A site requires "^8.0.0" -> valid
* A site requires "~8.0" -> valid
* A site requires "~8.0.0" -> invalid
Currently, this constraint check is used to determine which versions
that are currently installed are good suggestions to switch to.
If you have a site with constraint "^8.0" for example, and you have
PHP 8.0 and 8.1 installed (with 8.1 linked), then you will get a
suggestion to switch back to 8.0.
- Only works with dynamic icon enabled
- Preference defaults to true on new or existing installs
(because we want to display PHP next to the version number by default)
For those who love a minimal menu bar setup but still want to see what
PHP version is currently enabled, this is perfect.