Skip to content

Commit

Permalink
Update license
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrabera committed May 30, 2017
1 parent daad5c7 commit d240475
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 MEDIGO
Copyright (c) 2017 MEDIGO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# laika-php

Maintainer: Diego

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.

##Setup
## Setup

Add
```
"medigo/laika": "dev-master"
Expand All @@ -15,14 +14,17 @@ to composer.json and run
php composer.phar update
```

##How to use
## How to use

When using Laika you need to configure in your environment:

- 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

```
public function __construct($environment, $host, $username, $password)
{
Expand All @@ -31,15 +33,26 @@ public function __construct($environment, $host, $username, $password)
return $this->client;
}
```

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

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

## Test the library

Run

```
phpunit tests/LaikaTest.php
```

## Copyright and license

Copyright © 2017 MEDIGO GmbH.

Laika is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text.

0 comments on commit d240475

Please sign in to comment.