2017 © Pedro Peláez
 

library laika

image

medigo/laika

  • Thursday, January 18, 2018
  • by mbernardes
  • Repository
  • 14 Watchers
  • 0 Stars
  • 2,164 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

laika-php

laika-php is a PHP library that connects applications with the Laika feature flag service (https://github.com/MEDIGO/laika). It is used for applications to know which flags are activated in the current environment and adapt to it., (*1)

Setup

Add, (*2)

"medigo/laika": "dev-master"

to composer.json and run, (*3)

php composer.phar update

How to use

When using Laika you need to configure in your environment:, (*4)

  • environment name - environment in which the code is being executed (e.g. "test" or "dev").
  • url - url for the API server.
  • username (optional) - username for the basic authentication.
  • password (optional) - password for the basic authentication.

Initialize the library and get all the features from the database, (*5)

public function __construct($environment, $host, $username, $password)
{
    $this->client = new Laika($environment, $host, $username, $password);
    $this->client->fetchAllFeatures();
    return $this->client;
}

Use the isEnabled() function to know whether the flag is activated or not in the current environment., (*6)

$myVar = 'the flag is disabled';
if ($laika->isEnabled('FLAG_NAME')) {
  $myVar = 'the flag is enabled';
}

Test the library

Run, (*7)

phpunit tests/LaikaTest.php

Copyright © 2017 MEDIGO GmbH., (*8)

Laika is licensed under the MIT License. See LICENSE for the full license text., (*9)

The Versions

18/01 2018

dev-master

9999999-dev https://github.com/MEDIGO/laika-php

  Sources   Download

MIT

The Requires

 

The Development Requires

18/01 2018

2.1.0

2.1.0.0 https://github.com/MEDIGO/laika-php

  Sources   Download

MIT

The Requires

 

The Development Requires

30/05 2017

2.0.0

2.0.0.0 https://github.com/MEDIGO/laika-php

  Sources   Download

MIT

The Requires

 

The Development Requires