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

Add config option to disable clear command #87

Conversation

binaryfire
Copy link

@binaryfire binaryfire commented Jan 12, 2024

This allows the purify:clear command to be disabled if we're not using a unique cache store. It prevents devs from trying to manually clear old definitions and unknowingly nuking the entire app's cache. In-memory cache stores always get cleared eventually (eg. when upgrading to a newer version), so letting old definitions persist until then isn't really a problem.

It defaults to false if the config key isn't present, so it's backwards compatible.

|
*/

'disable_clear_command' => false,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I'm not sure I like a boolean config value to disable the command.

Maybe we should just add a warning (similar to the the default php artisan migrate command in production mode), that displays to the executor that it will wipe the entire cache if that driver is configured?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok no worries. Yeah that would definitely be better than nothing.

I'll probably still disable the command with some CommandStarting event hackery on my end.

@binaryfire binaryfire closed this Jan 18, 2024
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.

2 participants