GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wascloud/php-dark-launch: A Dark Launching library for PHP

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

69 Commits
69 Commits

Folders and files

NameName
Last commit message
Last commit date
application
application
 
 
features
features
 
 
src/TelusDigital
src/TelusDigital
 
 
.circle.yml
.circle.yml
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

PHP Dark Launch

Join the chat at https://gitter.im/telusdigital/php-dark-launch Code Climate Build Status Codeship Status for telusdigital/php-dark-launch

A PHP library to dark launch features

What is dark launching?

Table of contents

  • Installation
  • Usage
  • Methods
  • License
  • Contributors

Installation

composer require telusdigital/darklaunch

Usage

  • Tunables
  • Config

Initialize a Dark Launch object:

use TelusDigital\Dark_Launch;

// Dark Launching requires a redis instance to use
$redis = new Redis();
$redis->connection('127.0.0.1');

$params = ['redis' => $redis];
$dark_launch = new Dark_Launch($params);

Tunables:

  • $redis - obj - send a redis instance to it
  • $project - string the name of the project
  • $user - string - the name of the user dark launching
  • $config - array - an array of default dark launch values
// $redis
$redis = new Redis();
$redis->connect('127.0.0.1');


// $config
// this can be from a codeigniter config  
// e.g $this->load->config('dark_launch');
//     $config = $this->config->item('dark_launch_features');
$config = ['feature-1' => ['type' => 'boolean', 'value' => TRUE], 'feature-1' => ['type' => percentage, 'value' => 30]];

// passing params to Dark_Launch constructor
$params = ['redis' => $redis, 'config' => $config, 'user' => 'ben', 'project' => 'my-awesome-project']
$dark_launch = new Dark_Launch($params);

Config

Dark Launch defaults can be one of three types

  1. boolean A feature is enabled when value is TRUE
['type' => 'boolean', 'value' => TRUE]
  1. time A feature is enabled if in between start and stop time
['type' => 'time', 'start' => 1419451200, 'stop' => 1420056000]
  1. percentage A feature is enabled X % of the time
['type' => 'percentage', 'value' => 30]

Methods

feature_enabled()

Returns TRUE if a feature is enabled

$this->dark_launch->feature_enabled('my-awesome-feature');

projects()

Returns a list of projects

$this->dark_launch->projects();

users()

Returns a list of users for a project

$this->dark_launch->users();

features()

Returns a list of features for a project and user

$this->dark_launch->features();

get_feature()

Returns an associative array with attributes about a feature

$this->dark_launch->get_feature('my-awesome-feature');
// return = ['type' => 'boolean', 'value' => 'true']

enable_feature()

Enables a dark launch feature

$feature_name = 'my-awesome-feature'
$feature_value = ['type' => 'percent', 'value' => 30]
$this->dark_launch->enable_feature($feature_name, $feature_value);

disable_feature()

Disables a dark launch feature

$this->dark_launch->disable_feature('my-awesome-feature');

Running Tests

vendor/behat/behat/bin/behat

License

MIT

Contributors

  • Layne Geck | email
  • Prashant Kandathil | email
  • Ben Visser | email

About

A Dark Launching library for PHP

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.