[4.x] Enable pro fix and improvements #9763
Merged
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.
When working on the
php please multisite
command for #9632, I realized thatStatamic::enablePro()
updates the editions config, but #9435 introduced smarter logic to enable Statamic Pro using an .env var.What's changed?
If you have the newer editions config style with proper reference to the .env var, nothing has changed:
If it detects that your editions config is not properly referencing the .env var, it'll suggest the
--update-config
option:When running with
--update-config
, it'll update both your .env var and your editions config:And if it fails to update your editions config, you'll be given instructions on how to manually update this yourself:
Note: I don't think the
--update-config
should be default behaviour, because the only reason you'd run with--update-config
is for older apps where you want to migrate your editions config if it happens to still have a hardcoded boolean. As you can see above though, it's still user-friendly despite being opt-in.Why these changes?
pro:enable
command.--update-config
option, theStatamic::enablePro()
command can now programatically enable pro without any user intervention, but simply deferring to the command.Statamic::enablePro()
is completely broken on newer installs, because it doesn't touch the .env. This PR fixes all that 👍