-
Notifications
You must be signed in to change notification settings - Fork 49
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
[1.x] Allow excluding features from purge command #89
Conversation
$this->driver->purge($features); | ||
$this->driver->purge($features->all()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods support collections, but are typed to expect arrays. Fixing this while I notice it.
* Define the names of all defined features. | ||
* Retrieve the names of all defined features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here. Now matches the interface's comment.
class Decorator implements DriverContract | ||
class Decorator implements CanListStoredFeatures, Driver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the useless Contract
suffix here to match the other drivers.
Re-implementation of #87
Documentation: laravel/docs#9448
Allows for excluding features from the purge command. This command now has the following API:
--except-registered
?You could run this on deploy to clear out feature flags you no longer use.
Warning
Pennant allows you to dynamically register features, i.e., they don't have to be defined in a service provider. If you use this flag it may clear features you still use in your application if you are using dynamic registration.
Use in combination
The command handles using all of these in combination, e.g., it will be able to handle the following...
The excepts will always take precedence and ensure that any features found in that list are not purged, even if they are explicitly passed to the command like we did with
foo
andbar
.3rd party drivers
Drivers should implement the
CanListStoredFeatures
interface if they wish to support these new features. This contract adds a single new method,stored
, which returns a unique list of stored feature names - similar to thedefined
interface method which returns a unique list of all the defined feature names.