Download the PHP package novaway/feature-flag-bundle without Composer
On this page you can find all versions of the php package novaway/feature-flag-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package feature-flag-bundle
FeatureFlagBundle
The FeatureFlagBundle is a bundle to manage features flags in your Symfony applications.
⚠️ You're currently reading the documentation for the next major version. Refer to the 2.x documentation to read the stable version documentation.
Compatibility
This bundle is tested with at least all maintained Symfony version.
Documentation
Install it
Install extension using composer:
If you don't use Flex, enable the bundle in your config/bundles.php
file:
Configuration
To configure and register a feature manager you need a factory service. You may also need to change some options to the factory.
The factories that come with this bundle can be found in the table below.
Factory service id | Options |
---|---|
novaway_feature_flag.factory.array | features |
Example configuration
You can declare multiple managers. Multiple providers is useful if you want to use different storage providers or to isolate your features flags.
When several managers are defined, they are registered in the Symfony dependency injection container as services with the following naming convention: novaway_feature_flag.manager.<manager_name>
.
For example, the manager_bar
is accessible with the following service name: novaway_feature_flag.manager.manager_bar
.
Manager storage are also registered in the Symfony dependency injection container as services with the following naming convention: novaway_feature_flag.storage.<manager_name>
.
Use it as a service
The bundle adds a global novaway_feature_flag.manager
(also bind to FeatureManager
) service you can use in your PHP classes.
In the case you have defined several managers, the service use the ChainedFeatureManager
class to chain all declared managers.
In your Twig templates
You can also check a flag in your templates:
In the routing configuration
The package allows you to restrict a controller access by adding some configuration in your routing definition.
As a controller attribute
You can also restrict a controller access with attributes, two attributes are available:
Novaway\Bundle\FeatureFlagBundle\Attribute\FeatureEnabled
Novaway\Bundle\FeatureFlagBundle\Attribute\FeatureDisabled
Implement your own storage provider
- First your need to create your storage provider class which implement the
Novaway\Bundle\FeatureFlagBundle\Storage\StorageInterface
interface - Register it in the Symfony dependency injection container
- Specify the storage you want to use in a manager configuration
When you create a storage, the static method create
is called to create the storage instance.
License
This library is published under MIT license
All versions of feature-flag-bundle with dependencies
ext-json Version *
doctrine/annotations Version ^1.12|^2.0
symfony/framework-bundle Version ~4.4|~5.0|~6.0
symfony/yaml Version ~4.4|~5.0|~6.0