Download the PHP package socloz/feature-flag-bundle without Composer

On this page you can find all versions of the php package socloz/feature-flag-bundle. 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-flag-bundle

FeatureFlagBundle

A bundle to manage feature flags & A/B tests

this bundle is not production-ready - some features have not been fully developed or tested

Dependencies

Feature flags

Features are defined in the application configuration. Features can be enabled/disabled :

A feature can have the following default state :

A/B Testing

A feature can have multiple variations. The list of variations is defined in your configuration file, and it is your responsibility to modify your templates according to those variations.

Variations are automatically chosen by the bundle, but can be changed :

The service provides a simple success/failure couting mechanism. You can also use your favorite external analytics service.

Configuration

The basic configuration is :

Other options :

Using feature flags

Testing if a feature is enabled for the current user :

PHP

Twig

Enabling/disabling a feature for the current user :

PHP

Using A/B Testing

Getting the feature variation for the current user :

PHP

Twig

Couting transactions :

PHP

Analytics call :

Twig

Admin interface

The admin interface is located at /feature-flag/admin/features.

To use the admin interface, you must load the admin routes in routing.yml:

The twig template use Twitter Bootstrap CSS classes, but does not include Twitter Bootstrap.

You can override the layout by creating a app/Resources/SoclozFeatureBundle/views/layout-admin.html.twig file, such as :

You have to secure the admin route in your security.yml file :

Use whatever role is appropriate...

Front-end controllers

If you want to be able to switch features or variations for the current session, load the corresponding routes :

You can toggle a service for the current session using /feature-flag/{feature name}/enable and /feature-flag/{feature name}/disable.

You can change variation for the current session using /feature-flag/{feature name}/change_variation/{variation}.

The controllers redirect to the route configured as socloz_feature_flag.options.base.redirect (use route names).

You can display the feature state or variation using /feature-flag/{feature name}/status or /feature-flag/{feature name}/ab_status

Page-level toggles

You can change variation or toggle features using query string parameters :

Google Analytics

The Google Analytics implementation expects that you use the async Google Analytics tag. If your tag looks like this :

everything is fine. If it does not look like it, analytics won't work.

A single custom variable (session level) is used for all features. Therefore, you have to use the same variation set for all your features, and use the socloz_feature_flag.splitter.shared_random splitter (see below).

The custom variable can be configured using :

Advanced configuration

All internal services can be overloaded :

Splitter service

Configuration : socloz_feature_flag.services.splitter

The splitter service chooses a variation for the current user. The available splitters are :

A custom splitter can be written. It must implement Socloz\FeatureFlagBundle\ABTesting\Splitter\SplitterInterface.

Transaction service

Configuration : socloz_feature_flag.services.transaction

The transaction service counts successful transactions.

There is only one transaction implemented : socloz_feature_flag.transaction.session.

A custom transaction service can be written. It must implement Socloz\FeatureFlagBundle\ABTesting\Transaction\TransactionInterface.

State services

Configuration : socloz_feature_flag.services.state

The features states for the current user are stored/recalled from a list of state services. State is written to all services, and is read from the first one.

The default is : [socloz_feature_flag.state.request, socloz_feature_flag.state.session].

A custom state service can be written. It must implement Socloz\FeatureFlagBundle\State\StateInterface.

Storage service

Configuration : socloz_feature_flag.services.storage

The storage service stores global data (feature states, counts, ...)

The default is : socloz_feature_flag.storage.redis.

A custom storage service can be written. It must implement Socloz\FeatureFlagBundle\Storage\StorageInterface.

Analytics service

Configuration : socloz_feature_flag.services.analytics

The storage service generates the HTML code used to call the external analytics service.

The default is : socloz_feature_flag.analytics.google_analytics.

A custom analytics service can be written. It must implement Socloz\FeatureFlagBundle\Analytics\AnalyticsInterface.

License

This bundle is released under the MIT license (see LICENSE).


All versions of feature-flag-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/framework-bundle Version ~2.0
php Version >=5.3.2
ext-redis Version *
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 socloz/feature-flag-bundle contains the following files

Loading the files please wait ....