PHP client for Unleash
THIS IS NOT READY TO BE USED YET! If you want to have a PHP client for Unleaseh, please contribute!
This client will only happen if someone wants to contribute. Just create an issue reuest if you are interested in contributing.
Install the library via composer (currently you need to provide the repository in the composer.json first):
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Unleash/unleash-client-php.git"
}
]
Then you can require the library via the commandline.
composer require unleash/client
// initialize the client
$unleashClient = new \Unleash\Unleash(
$appName,
$url,
$instanceId = null,
);
// to retrieve the current state of the feature flags
$unleashClient->fetch();
// check if a feature is enabled
if ($unleashClient->isEnabled('amazing_feature')) {
echo 'Dude that amazing feature is enabled!';
}
See https://unleash.github.io/ for details.
Operations > Feature Flags
amazing_feature
See https://docs.gitlab.com/ee/user/project/operations/feature_flags.html for more details.
We use phpunit for testing, which is installed as dev dependency. You can execute the tests by executing
phpunit