diff --git a/LICENSE b/LICENSE index 0669f67..dceae34 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/README.md b/README.md index 2212c2e..1d4238c 100644 --- a/README.md +++ b/README.md @@ -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" @@ -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) { @@ -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. \ No newline at end of file