Download the PHP package trompette/feature-toggles without Composer

On this page you can find all versions of the php package trompette/feature-toggles. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package feature-toggles

Stable Version Automated Tests Static Analysis

trompette/feature-toggles

This PHP library implements a feature toggle infrastructure.

Using trompette/feature-toggles library can help a team to deliver new features to users iteratively and safely, in other words: it enables continuous deployment.

For more information on the topic, see Feature Toggles (aka Feature Flags) on MartinFowler.com.

Installation

The trompette/feature-toggles library is distributed on Packagist.

It can be added as a project dependency with the following command:

Standalone usage

When working on a new version of a page, deploying gradually the new version can bring a lot of confidence to a team.

But it also brings more work, as the team needs to:

With trompette/feature-toggles library, enabling the new version is done by asking the toggle router if the current user has a feature:

Feature registry

Before using the toggle router, new_page_version feature has to be registered:

Toggling strategies

When defining a feature, a toggling strategy has to be referenced to specify the algorithm deciding if a target has a feature.

Implemented strategies are:

And strategies can be combined with boolean operators, like so: onoff and whitelist, onoff or whitelist or percentage, etc.

Toggle router

Now that the feature registry is configured, the toggle router can be created:

Strategies are injected as an array indexed with names: these are the references that should be used when registering features.

Feature configuration

The toggle router can be used to configure a feature for a given strategy:

Configuration changes are persisted by calling the associated method on the strategy instance.

All Doctrine DBAL configuration repositories can migrate a schema, since they all implement the SchemaMigrator interface:

Usage with Symfony

All previous code is optional when using Symfony: everything is glued together by the FeatureTogglesBundle class.

Registering the bundle in config/bundles.php is needed to benefit from the Symfony integration:

Bundle configuration

The bundle can be configured as described by config:dump-reference:

For technical details, see FeatureTogglesConfiguration class.

Container services

There is only one service declared as public: the toggle router with Trompette\FeatureToggles\ToggleRouter or Trompette\FeatureToggles\ToggleRouterInterface as identifier.

There are also useful console commands defined as services and tagged with console.command:

More information about the commands can be found in their help messages.

For technical details, see FeatureTogglesExtension class.

License

The trompette/feature-toggles library is released under the MIT License.

See the LICENSE file for more details.

Acknowledgments

The trompette/feature-toggles library is inspired by a practice and a tool used by the Food Assembly development team.

The team discovered the practice with the article Web Experimentation with New Visitors on Etsy's Engineering Blog.


All versions of feature-toggles with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
beberlei/assert Version >=3.2
doctrine/dbal Version >=3.8
psr/log Version >=1.1
symfony/config Version >=5.4
symfony/console Version >=5.4
symfony/expression-language Version >=5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package trompette/feature-toggles contains the following files

Loading the files please wait ....