2017 © Pedro Peláez
 

library bandiera-client-php

Bandiera is a simple, stand-alone feature flagging service that is not tied to any existing web framework or language. This is a client for talking to the web service.

image

npg/bandiera-client-php

Bandiera is a simple, stand-alone feature flagging service that is not tied to any existing web framework or language. This is a client for talking to the web service.

  • Tuesday, February 16, 2016
  • by romulodl
  • Repository
  • 290 Watchers
  • 5 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Bandiera PHP Client

This is a client for talking to the Bandiera feature flagging service from a PHP application., (*1)

This client is compatible with the v2 Bandiera API., (*2)

Build status MIT licensed, (*3)

Installation

Installation is done via composer. In your composer.json file add:, (*4)

{
    "require": {
        "npg/bandiera-client-php": "~1.0"
    }
}

Usage

You can interact with the Bandiera server like so:, (*5)

<?php

include 'vendor/autoload.php';

$bandiera = new Nature\Bandiera\Client('http://bandiera-demo.herokuapp.com');

if ($bandiera->isEnabled('my_app', 'super_new_feature')) {
    // show the super new feature!
}

The Nature\Bandiera\Client::isEnabled command takes two main arguments - the 'feature group', and the 'feature name'. This is because in Bandiera, features are organised into groups as it is intented as a service for multiple applications to use at the same time - this organisation allows separation of feature flags that are intended for different audiences., (*6)

Nature\Bandiera\Client::isEnabled also takes an optional params array, this is for use with some of the more advanced features in Bandiera - user group and percentage based flags. It is in this params array you pass in your user_group and user_id, i.e.:, (*7)

$bandiera->isEnabled('my_app', 'super_new_feature', [
    'user_id' => 1234567,
    'user_group' => 'Administrators'
]);

For more information on these advanced features, please see the Bandiera wiki:, (*8)

https://github.com/springernature/bandiera/wiki/How-Feature-Flags-Work#feature-flags-in-bandiera, (*9)

Direct API Access

If you'd prefer not to use the isEnabled method for featching feature flag values, the following methods are available..., (*10)

Get features for all groups:, (*11)

Nature\Bandiera\Client::getAll($params = []);

Get features for a group:, (*12)

Nature\Bandiera\Client::getFeaturesForGroup($group, $params = []);

Get an individual feature:, (*13)

Nature\Bandiera\Client::getFeature($group, $feature, $params = []);

Development

  1. Fork this repo.
  2. Run composer install

License

© 2014 Springer Nature. Bandiera PHP Client is licensed under the MIT License., (*14)

The Versions

16/02 2016

dev-master

9999999-dev https://github.com/springernature/bandiera

Bandiera is a simple, stand-alone feature flagging service that is not tied to any existing web framework or language. This is a client for talking to the web service.

  Sources   Download

MIT

The Requires

 

The Development Requires

feature flag feature toggle feature flagging

07/07 2015

1.0.1

1.0.1.0 https://github.com/nature/bandiera

Bandiera is a simple, stand-alone feature flagging service that is not tied to any existing web framework or language. This is a client for talking to the web service.

  Sources   Download

MIT

The Requires

 

The Development Requires

feature flag feature toggle feature flagging

07/07 2015

1.0.0

1.0.0.0 https://github.com/nature/bandiera

Bandiera is a simple, stand-alone feature flagging service that is not tied to any existing web framework or language. This is a client for talking to the web service.

  Sources   Download

MIT

The Requires

 

The Development Requires

feature flag feature toggle feature flagging