<commit_before># Dark Launch Codeigniter

A CodeIgniter library to dark launch features

[What is dark launching?](http://changelog.ca/log/2012/07/19/dark_launching_software_features)

## Table of contents

- [Installation](#installation)
- [Usage](#usage)
- [Methods](#methods)
- [License](#license)
- [Contributors](#contributors)
- [TODO](#TODO)


## Installation

1. Clone this repo 
2. Move `application/libraries/Dark_launch.php` and `application/config/dark_launch.php` into their respective folders in your project.
3. Use `require_once` to require `libraries/Dark_launch.php` in your controllers or autoload it via your preferred method

## Usage

// TODO: write usage

### Tunables:
- // $redis - send a redis instance to it 
- // $project - the name of the project e.g uss-consumer
- // $user - the name of the user dark launching e.g x173034


## Methods

// TODO: write methods

### feature_enabled()
Check if a feature is enabled
```php
$this->dark_launch->feature_enabled();
```

## License
[MIT](https://tldrlegal.com/license/mit-license)

## Contributors
* <NAME> | [email](mailto:<EMAIL>)
* <NAME> | [email](mailto:<EMAIL>)

## TODO

- Write some tests with behat!<commit_msg>updated README -> removed all reference to codeigniter<commit_after># Dark Launch Codeigniter

A CodeIgniter library to dark launch features

[What is dark launching?](http://changelog.ca/log/2012/07/19/dark_launching_software_features)

## Table of contents

- [Installation](#installation)
- [Usage](#usage)
- [Methods](#methods)
- [License](#license)
- [Contributors](#contributors)
- [TODO](#TODO)


## Installation

``` composer require telusdigital/darklaunch ```

## Usage
Initialize a Dark Launch object:

```php
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

```php
// $redis
$redis = new Redis();
$redis->connection('127.0.0.1');


// $config
// this can be from a codeigniter config  
// e.g $this->load->config('dark_launch');
//     $this->config->item('dark_launch_features');
// see [config](#config) for more information

$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
2. time
3. percentage

## Methods

// TODO: write methods

### feature_enabled()
Check if a feature is enabled
```php
$this->dark_launch->feature_enabled();
```

## License
[MIT](https://tldrlegal.com/license/mit-license)

## Contributors
* <NAME> | [email](mailto:<EMAIL>)
* <NAME> | [email](mailto:<EMAIL>)

## TODO

- Write some tests with behat!
{'fraction_non_alphanumeric': 0.16259904912836767, 'fraction_numerical': 0.013946117274167988, 'mean_word_length': 4.450777202072539, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 33, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6451791', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1021, 'n_words': 299}