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

[4.x] Enable pro fix and improvements #9763

Merged
merged 6 commits into from Mar 21, 2024
Merged

Conversation

jesseleite
Copy link
Member

@jesseleite jesseleite commented Mar 20, 2024

When working on the php please multisite command for #9632, I realized that Statamic::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:

CleanShot 2024-03-19 at 22 32 22

If it detects that your editions config is not properly referencing the .env var, it'll suggest the --update-config option:

image

When running with --update-config, it'll update both your .env var and your editions config:

CleanShot 2024-03-19 at 22 27 00

And if it fails to update your editions config, you'll be given instructions on how to manually update this yourself:

CleanShot 2024-03-19 at 22 29 53

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?

  1. Better UX for the pro:enable command.
  2. With this new --update-config option, the Statamic::enablePro() command can now programatically enable pro without any user intervention, but simply deferring to the command.
    • Technically, Statamic::enablePro() is completely broken on newer installs, because it doesn't touch the .env. This PR fixes all that 👍

@jesseleite jesseleite marked this pull request as ready for review March 20, 2024 02:54
@jesseleite jesseleite changed the title [4.x] Enable pro improvements [4.x] Enable pro fix and improvements Mar 20, 2024
@jesseleite jesseleite marked this pull request as draft March 20, 2024 20:12
@jesseleite jesseleite marked this pull request as ready for review March 20, 2024 22:34
@jasonvarga jasonvarga merged commit 0ae2e9a into 4.x Mar 21, 2024
35 checks passed
@jasonvarga jasonvarga deleted the feature/enable-pro-improvements branch March 21, 2024 19:31
@jesseleite jesseleite mentioned this pull request Apr 5, 2024
33 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants