PHPackages                             hellofresh/launchdarkly-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hellofresh/launchdarkly-php

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

hellofresh/launchdarkly-php
===========================

Official LaunchDarkly SDK for PHP

3.0.2(9y ago)020.0k[4 PRs](https://github.com/hellofresh/launchdarkly-php-client/pulls)Apache-2.0PHPPHP &gt;=5.5CI passing

Since Dec 31Pushed 2y ago2 watchersCompare

[ Source](https://github.com/hellofresh/launchdarkly-php-client)[ Packagist](https://packagist.org/packages/hellofresh/launchdarkly-php)[ Docs](https://github.com/launchdarkly/php-client)[ RSS](/packages/hellofresh-launchdarkly-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (8)Versions (34)Used By (0)

LaunchDarkly SDK for PHP
========================

[](#launchdarkly-sdk-for-php)

[![Code Climate](https://camo.githubusercontent.com/915aeff15067ea37983c398e89a508e51ffac356f7c599350acf8cbbff214b8c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6c61756e63686461726b6c792f7068702d636c69656e742f6261646765732f6770612e737667)](https://codeclimate.com/github/launchdarkly/php-client)

[![Circle CI](https://camo.githubusercontent.com/85b5d57515d9b7c5e6950a79e6869fbeb4b245de0d659ec58583861b89494e89/68747470733a2f2f636972636c6563692e636f6d2f67682f6c61756e63686461726b6c792f7068702d636c69656e742e7376673f7374796c653d737667)](https://circleci.com/gh/launchdarkly/php-client)

Requirements
------------

[](#requirements)

1. PHP 5.5 or higher.

Quick setup
-----------

[](#quick-setup)

1. Install the PHP SDK and monolog for logging with [Composer](https://getcomposer.org/)

    ```
     php composer.phar require launchdarkly/launchdarkly-php

    ```
2. After installing, require Composer's autoloader:

    ```
     require 'vendor/autoload.php';

    ```
3. Create a new LDClient with your SDK key:

    ```
     $client = new LaunchDarkly\LDClient("your_sdk_key");

    ```

Your first feature flag
-----------------------

[](#your-first-feature-flag)

1. Create a new feature flag on your [dashboard](https://app.launchdarkly.com)
2. In your application code, use the feature's key to check whether the flag is on for each user:

    ```
     $user = new LaunchDarkly\LDUser("user@test.com");
     if ($client->variation("your.flag.key", $user)) {
         # application code to show the feature
     } else {
         # the code to run if the feature is off
     }

    ```

Fetching flags
--------------

[](#fetching-flags)

There are two approaches to fetching the flag rules from LaunchDarkly:

- Making HTTP requests (using Guzzle)
- Setting up the [ld-daemon](https://github.com/launchdarkly/ld-daemon) to store the flags in Redis

Using Guzzle
============

[](#using-guzzle)

To use Guzzle it must be required as a dependency:

```
php composer.phar require "guzzlehttp/guzzle:6.2.1"
php composer.phar require "kevinrob/guzzle-cache-middleware:1.4.1"

```

It will then be used as the default way of fetching flags.

Using Redis
===========

[](#using-redis)

1. Require Predis as a dependency:

    php composer.phar require "predis/predis:1.0.\*"
2. Create the LDClient with the Redis feature requester as an option:

    $client = new LaunchDarkly\\LDClient("your\_sdk\_key", \['feature\_requester\_class' =&gt; 'LaunchDarkly\\LDDFeatureRequester'\]);

Learn more
----------

[](#learn-more)

Check out our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](http://docs.launchdarkly.com/docs/php-sdk-reference).

Contributing
------------

[](#contributing)

We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work.

About LaunchDarkly
------------------

[](#about-launchdarkly)

- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
    - Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
    - Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
    - Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
    - Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
- LaunchDarkly provides feature flag SDKs for
    - [Java](http://docs.launchdarkly.com/docs/java-sdk-reference "Java SDK")
    - \[JavaScript\] ( "LaunchDarkly JavaScript SDK")
    - \[PHP\] ( "LaunchDarkly PHP SDK")
    - \[Python\] ( "LaunchDarkly Python SDK")
    - \[Python Twisted\] ( "LaunchDarkly Python Twisted SDK")
    - \[Go\] ( "LaunchDarkly Go SDK")
    - \[Node.JS\] ( "LaunchDarkly Node SDK")
    - \[.NET\] ( "LaunchDarkly .Net SDK")
    - \[Ruby\] ( "LaunchDarkly Ruby SDK")
    - \[iOS\] ( "LaunchDarkly iOS SDK")
    - \[Android\] ( "LaunchDarkly Android SDK")
- Explore LaunchDarkly
    - \[launchdarkly.com\] ( "LaunchDarkly Main Website") for more information
    - \[docs.launchdarkly.com\] ( "LaunchDarkly Documentation") for our documentation and SDKs
    - \[apidocs.launchdarkly.com\] ( "LaunchDarkly API Documentation") for our API documentation
    - \[blog.launchdarkly.com\] ( "LaunchDarkly Blog Documentation") for the latest product updates
    - \[Feature Flagging Guide\] ( "Feature Flagging Guide") for best practices and strategies

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 63.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Total

21

Last Release

3486d ago

Major Versions

0.7.0 → 1.0.02016-07-25

1.0.0 → 2.0.02016-08-10

2.0.1 → 3.0.02016-12-13

PHP version history (2 changes)0.1.0PHP &gt;=5.4

1.0.0PHP &gt;=5.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1108049?v=4)[Ítalo Vietro](/maintainers/italolelis)[@italolelis](https://github.com/italolelis)

---

Top Contributors

[![jkodumal](https://avatars.githubusercontent.com/u/19426?v=4)](https://github.com/jkodumal "jkodumal (83 commits)")[![richardmiller-zz](https://avatars.githubusercontent.com/u/783827?v=4)](https://github.com/richardmiller-zz "richardmiller-zz (10 commits)")[![pkaeding](https://avatars.githubusercontent.com/u/13951?v=4)](https://github.com/pkaeding "pkaeding (9 commits)")[![drichelson](https://avatars.githubusercontent.com/u/602409?v=4)](https://github.com/drichelson "drichelson (8 commits)")[![mrdon](https://avatars.githubusercontent.com/u/18610?v=4)](https://github.com/mrdon "mrdon (7 commits)")[![arun251](https://avatars.githubusercontent.com/u/1594156?v=4)](https://github.com/arun251 "arun251 (5 commits)")[![italolelis](https://avatars.githubusercontent.com/u/1108049?v=4)](https://github.com/italolelis "italolelis (3 commits)")[![kieranajp](https://avatars.githubusercontent.com/u/681426?v=4)](https://github.com/kieranajp "kieranajp (3 commits)")[![hf-ghas-integration-bot](https://avatars.githubusercontent.com/u/67641493?v=4)](https://github.com/hf-ghas-integration-bot "hf-ghas-integration-bot (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![denieler](https://avatars.githubusercontent.com/u/2836281?v=4)](https://github.com/denieler "denieler (1 commits)")

---

Tags

wiz-unknownlaunchdarklylaunchdarkly php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hellofresh-launchdarkly-php/health.svg)

```
[![Health](https://phpackages.com/badges/hellofresh-launchdarkly-php/health.svg)](https://phpackages.com/packages/hellofresh-launchdarkly-php)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.5k](/packages/laravel-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[launchdarkly/server-sdk

Official LaunchDarkly SDK for PHP

3911.3M13](/packages/launchdarkly-server-sdk)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M534](/packages/shopware-core)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69357.9k](/packages/run-as-root-magento2-prometheus-exporter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
