Skip to content

Update php-5.3 branch #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 201 commits into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
adea7a0
Send the default value back to LD
jkodumal Feb 3, 2016
daec685
Split events_uri into a different configuration parameter
jkodumal Feb 8, 2016
034300c
The events URI should point to /bulk, not /api/events/bulk
jkodumal Feb 8, 2016
a1a09c1
Allow paths to be specified for custom events URIs
jkodumal Feb 9, 2016
d77340a
Merge pull request #24 from launchdarkly/jko/send-default
jkodumal Feb 9, 2016
a6a6e25
Merge pull request #25 from launchdarkly/jko/events-uri
jkodumal Feb 9, 2016
6e2ee66
Bump version to 0.7.0
jkodumal Feb 9, 2016
9182785
bumped sdk
Feb 9, 2016
46983ad
Revert "bumped sdk"
Feb 9, 2016
77d491b
Make Guzzle 5 a suggestion not a requirement
richardmiller-zz Jun 17, 2016
b696bed
Increase minimum PHP version to 5.5
richardmiller-zz Jun 23, 2016
51cf2e6
Use php 5.5.36 for circleci
richardmiller-zz Jun 23, 2016
4000f37
Use a supported version of php 5.5 for circleci
richardmiller-zz Jun 23, 2016
a0a8ca4
Fix zend-serializer version to 2.7.* to avoid php 5.6 requirement
richardmiller-zz Jun 23, 2016
bbc7bb0
Add missing property declaration
richardmiller-zz Jun 23, 2016
fdb4548
Merge pull request #29 from richardmiller/add-missing-property
jkodumal Jun 23, 2016
60c2561
Merge pull request #27 from richardmiller/make-guzzle-a-suggestion
jkodumal Jul 13, 2016
656bc91
Update to latest stable phpunit
richardmiller-zz Jul 14, 2016
3349a3b
Check that FeatureRequester class in options is valid
richardmiller-zz Jun 23, 2016
b88163c
Downgrade to phpunit 5.3.5 as 5.4.* requires php >= 5.6
richardmiller-zz Jul 14, 2016
b7810f3
Downgrade phpunit to 4.8.26 to allow for PHP 5.3
richardmiller-zz Jul 14, 2016
bc0fcee
Merge pull request #28 from richardmiller/check-feature-requester-int…
jkodumal Jul 14, 2016
1b2e675
Update Guzzle, change http client cache
Jul 22, 2016
c967b31
wip
Jul 22, 2016
4ad38ed
FeatureRequester works with Guzzle 6, but no caching yet
Jul 23, 2016
1f35760
[wip] add cache
Jul 23, 2016
826a5fa
New http client caching works.
Jul 23, 2016
a15a47d
remove dev version
Jul 23, 2016
8912139
Update version
Jul 23, 2016
10a60c8
Update version in other place
Jul 23, 2016
428e36c
maybe a no-op.
Jul 23, 2016
1f34437
make guzzle required
Jul 23, 2016
132453a
Make guzzle optional. Update README.
Jul 23, 2016
5cfbc9c
Add dev requirements
Jul 23, 2016
a903193
composer update
Jul 23, 2016
a02ebff
Merge pull request #31 from launchdarkly/dr/httpoxy
drichelson Jul 25, 2016
dc4ee02
[wip] V2 data model + evaluation start.
Jul 28, 2016
7221ffc
[wip] V2 data model + evaluation start.
Jul 28, 2016
02f4118
[wip] V2 eval works.
Aug 1, 2016
5b9defd
[wip] Move some things out of big file.
Aug 1, 2016
2ce8d58
[wip] v2 events work ok- but not prereqs.
Aug 1, 2016
100d34d
[wip] v2 events work ok including prereqs.
Aug 1, 2016
6beeb75
Use standard logging interface. Log more/better things
Aug 1, 2016
35766f3
Remove v1 code. Other cleanup
Aug 1, 2016
c191a07
update version.
Aug 1, 2016
efe65f9
remove whitespace
Aug 1, 2016
674dc1b
Address PR comments. Deprecate toggle function. Remove getFlag function
Aug 2, 2016
531a817
Merge pull request #33 from launchdarkly/dr/v2
drichelson Aug 3, 2016
f6d9231
api_key->sdk_key
Aug 4, 2016
2d5aaae
add secure mode hash function
Aug 4, 2016
b1ea596
Move all flag eval logic into FeatureFlag class.
Aug 4, 2016
a569bd2
allFlags
Aug 4, 2016
98477de
Add allFlags().
Aug 4, 2016
0468c8d
Merge branch 'v2' into dr/evenMoreV2
Aug 4, 2016
1d1b3c6
remove comments
Aug 4, 2016
024b162
add stub method in test class
Aug 4, 2016
897e0d6
Merge pull request #34 from launchdarkly/dr/evenMoreV2
drichelson Aug 4, 2016
329b574
Allow blank user key in evaluation.
Aug 8, 2016
e067d0b
Merge pull request #35 from launchdarkly/dr/allowBlankUserKey
drichelson Aug 8, 2016
f3fe42a
Change user key null check
Aug 9, 2016
98e55f1
add better check for blank user key
Aug 9, 2016
87f37d4
add better check for blank user key
Aug 9, 2016
cc81f8e
add better check for blank user key
Aug 9, 2016
392cefc
add better check for blank user key
Aug 9, 2016
88f89d5
Change log for v2. Update license file
jkodumal Aug 10, 2016
94727af
stop getting latest flags
Aug 10, 2016
0a254cf
stop getting latest flags
Aug 10, 2016
5a5fb3e
Revert log statement
Aug 10, 2016
8a5ef6e
Merge pull request #37 from launchdarkly/dr/v2ForReal
drichelson Aug 10, 2016
36bedee
Merge pull request #36 from launchdarkly/jko/v2-changelog
jkodumal Aug 10, 2016
e6f45c0
when requesting a feature and we get 404: log warning instead of error
Aug 12, 2016
0ba48fd
Update README.md
Sep 1, 2016
7d11a2e
Merge branch 'master' of https://github.com/launchdarkly/php-client
Sep 27, 2016
1a2ceca
Update readme
drichelson Nov 8, 2016
2b5293a
Merge branch 'master' of https://github.com/launchdarkly/php-client
Nov 8, 2016
421933e
Update readme
Nov 8, 2016
f6fd57d
Add monolog dep as required
Nov 8, 2016
2976ea0
Merge pull request #42 from launchdarkly/dr/addMonologDep
drichelson Nov 8, 2016
a6f1f2c
Bump version to 2.0.1
Nov 9, 2016
004cc70
Update Readme
drichelson Nov 9, 2016
fa2097d
Update README.md file
denieler Nov 28, 2016
8bdfedf
Merge pull request #44 from denieler/patch-1
jkodumal Nov 28, 2016
bb5b793
Update README.md
Nov 30, 2016
9579ba4
add phpunit config with a whitelist so that coverage reports can be g…
abacaphiliac Dec 16, 2016
b6bc65b
Merge pull request #45 from abacaphiliac/add-phpunit-config
drichelson Dec 23, 2016
93b4388
rename phpunit file
Dec 23, 2016
09efa54
change php version
Dec 23, 2016
5d72458
update Readme
Dec 23, 2016
9f75ad2
install php55-php71 with docker. run tests after installing minimum a…
abacaphiliac Jan 1, 2017
a0deaf3
Update version to 2.0.2
Jan 4, 2017
aedecb3
Merge pull request #51 from abacaphiliac/circle-multi-php-docker
drichelson Jan 4, 2017
0a8e34b
simplifiy docker build commands.
abacaphiliac Jan 5, 2017
5d661c2
Update to 2.0.3
Jan 5, 2017
8a88c3e
add monolog to integration-test composer config.
abacaphiliac Jan 6, 2017
373d43f
Merge pull request #55 from abacaphiliac/add-monolog-to-integration-t…
drichelson Jan 16, 2017
92a2699
refactor integration-test feature-generator to match v2 feature struc…
abacaphiliac Jan 19, 2017
66656c7
split vagrant user bootstrap from root bootstrap. provisioner correct…
abacaphiliac Jan 19, 2017
e0efa74
add integration tests to CircleCI build. starts redis server on Circl…
abacaphiliac Jan 19, 2017
ea7b962
Relax strict dependency versions
Jan 26, 2017
3125691
Update version and Changelog for 2.0.4
Jan 27, 2017
3738d6a
Merge pull request #54 from abacaphiliac/circle-docker-cleanup
drichelson Jan 27, 2017
a7e02e2
Merge pull request #59 from launchdarkly/dr/relaxStrictDeps
drichelson Jan 27, 2017
6ca5d4b
Try different monolog version
Jan 31, 2017
4a523fe
Merge pull request #58 from abacaphiliac/update-provisioner-3
drichelson Feb 2, 2017
f497973
Update bootstrap.sh shell script
drichelson Feb 2, 2017
440f7dd
Update bootstrap-user.sh shell script
drichelson Feb 2, 2017
0a7bd12
drop php54 from the integration-test Vagrant VM, as this package offi…
abacaphiliac Feb 3, 2017
59109b1
Relax monolog version
Feb 3, 2017
fac0b40
Relax monolog version.
Feb 3, 2017
bbf5d45
Merge branch 'master' into dr/monologVersion
Feb 3, 2017
e6660d4
Merge pull request #64 from launchdarkly/dr/monologVersion
drichelson Feb 3, 2017
016026c
further loosen composer dependencies, and fix monolog dependency (Err…
abacaphiliac Feb 4, 2017
6847a44
Merge pull request #63 from abacaphiliac/loosen-deps
drichelson Feb 7, 2017
208b9f8
Update Changelog, etc for 2.0.6
Feb 7, 2017
241bca5
Merge pull request #62 from abacaphiliac/drop-php54
drichelson Feb 16, 2017
db2d6a2
fix `WARNING: array_map(): Argument #2 should be an array in vendor/l…
abacaphiliac Feb 17, 2017
a1b745f
Fixes #67
tiagobutzke Feb 22, 2017
c1b3bb3
allow Predis\Client to be overridden via parameter. this will allow c…
abacaphiliac Feb 23, 2017
5086aa9
Merge pull request #68 from tiagobutzke/Fix-LDDFeatureRequester-json_…
arun251 Mar 1, 2017
fb358fa
Merge pull request #66 from abacaphiliac/fix-prerequisite-notice
arun251 Mar 1, 2017
acc1ac5
move Predis Client override into constructor (where it belongs), and …
abacaphiliac Mar 3, 2017
63f08c7
Release version 2.0.7
arun251 Mar 3, 2017
c1423c4
`warn` is a method on the concrete Logger impl from Monolog. `warning…
abacaphiliac Mar 13, 2017
b0787e5
Default was type hinted as boolean but can be anything.
jdrieghe Mar 14, 2017
f7ca356
Merge pull request #72 from jdrieghe/patch-1
arun251 Mar 14, 2017
014f3f8
allow feature-requester to be injected into the client rather than in…
abacaphiliac Mar 15, 2017
d7249ce
Merge pull request #71 from abacaphiliac/logger-interface
drichelson Mar 23, 2017
4d11ddd
Merge pull request #69 from abacaphiliac/predis-client-override
drichelson Mar 23, 2017
1fb031e
Merge pull request #73 from abacaphiliac/inject-feature-requester
drichelson Mar 23, 2017
06f0dff
Update Changelog, etc for 2.1.0
Mar 23, 2017
99297ba
Update README.md
jkodumal Apr 10, 2017
30e40be
Set target field to empty array whenever is null
Apr 10, 2017
cfaece1
Merge pull request #75 from idirouhab/master
arun251 Apr 10, 2017
7fe97d3
Ensure that FeatureFlag _rules is non-null
arun251 Apr 11, 2017
aa9bd6b
Merge pull request #1 from launchdarkly/arun/rules-guard
arun251 Apr 11, 2017
d9de3ea
Merge pull request #76 from launchdarkly/arun/rules-guard
arun251 Apr 11, 2017
f0ff5a9
Release version 2.1.1
arun251 Apr 11, 2017
f348c10
Fix markdown in README
arun251 Apr 11, 2017
054304c
Ensure that FeatureFlag _variations is non-null
Apr 12, 2017
455959d
Merge pull request #77 from idirouhab/master
arun251 Apr 22, 2017
920eae2
Add dependency suggestions
arun251 Apr 25, 2017
5f2f74c
Update README to use ld-relay
arun251 Apr 26, 2017
f34d64e
Merge pull request #2 from launchdarkly/arun/dont-require-cache-middl…
arun251 Apr 27, 2017
ea88b72
Add dependency suggestions (#78)
arun251 Apr 27, 2017
b0b75f0
Release version 2.1.2
arun251 Apr 27, 2017
3643078
Merge branch 'master'
arun251 Apr 27, 2017
67fc761
allow curl to be overridden.
abacaphiliac May 12, 2017
2ae3c69
Merge pull request #79 from abacaphiliac/curl-override
arun251 May 15, 2017
bcfa71a
clarifying ld-relay usage
adamlaunchingdarkly May 16, 2017
aa0035c
clarify role of guzzle
adamlaunchingdarkly May 16, 2017
c8995d0
recommending relay
adamlaunchingdarkly May 16, 2017
90e6bad
persistence with cache middleware
adamlaunchingdarkly May 17, 2017
35cb326
Merge branch 'master'
arun251 May 25, 2017
4e7022a
Merge pull request #3 from launchdarkly/adam/ld-relay-reference
arun251 May 25, 2017
c1fca88
[CH3370] Support publishing events via ld-relay
arun251 May 25, 2017
ae90fe1
Rename `apiKey` to `sdkKey`
arun251 May 25, 2017
384a406
Add documentation for GuzzleEventPublisher and CurlEventPublisher
arun251 May 25, 2017
c87b2f5
Merge pull request #4 from launchdarkly/arun/relay-events
arun251 May 25, 2017
630f575
Release version 2.2.0
arun251 Jun 6, 2017
bd3a930
Public access to flush method
Sep 6, 2017
1b8a81b
Fix class of LDClient::__construct cache option
pmeth Oct 6, 2017
1790701
Merge pull request #84 from pmeth/patch-1
arun251 Oct 6, 2017
32a48b7
Remove unused comment
Oct 6, 2017
de6de6d
Merge pull request #82 from foxted/master
arun251 Oct 6, 2017
909ccbc
Release version 2.3.0
arun251 Oct 6, 2017
e90344f
Merge branch 'master'
arun251 Oct 6, 2017
fbe5bfc
implement private user attributes
eplusminus Oct 13, 2017
7e95406
oh what the heck, let's write pure functions even in PHP
eplusminus Oct 13, 2017
9926122
consistent test names
eplusminus Oct 13, 2017
51a6af1
revise private user info naming conventions & methods to match Java SDK
eplusminus Oct 18, 2017
0bac87f
typo
eplusminus Oct 18, 2017
7475d87
unit tests for user builder
eplusminus Oct 18, 2017
913146e
factor out common logic
eplusminus Oct 18, 2017
2cfebd2
stop trying to do HTTP after we get a 401
eplusminus Oct 20, 2017
29ad461
better implementation - put entire client offline the first time we s…
eplusminus Oct 20, 2017
86b4524
revert unneeded changes
eplusminus Oct 20, 2017
02f4cef
revert CurlEventPublisher changes - see PR comments
eplusminus Oct 20, 2017
15fd0ef
typo
eplusminus Oct 21, 2017
01f65d8
Merge branch 'master' into php-5.3
eplusminus Dec 14, 2017
05b5594
closure fix for PHP 5.3
eplusminus Dec 14, 2017
bf21959
backporting to PHP 5.3
eplusminus Dec 14, 2017
afc6d71
use latest available php in build image
eplusminus Dec 14, 2017
8d6355a
partially revert merge of build file from master
eplusminus Dec 14, 2017
c518b74
typo
eplusminus Dec 14, 2017
cf7b3bb
rm reference to cache package
eplusminus Dec 14, 2017
805b5c8
backport to PHP 5.3
eplusminus Dec 14, 2017
a115976
backport to PHP 5.3
eplusminus Dec 14, 2017
625c65f
documentation fixes for PHP 5.3
eplusminus Dec 14, 2017
2f99fef
documentation fixes for PHP 5.3
eplusminus Dec 14, 2017
b7a007d
backport to Guzzle 3
eplusminus Dec 14, 2017
970e2ce
make sure flushing the queue actually flushes it
eplusminus Dec 14, 2017
82f97b7
backporting to PHP 5.3
eplusminus Dec 14, 2017
a3b86ca
use underscore naming convention for config options
eplusminus Jan 1, 2018
90dfe93
document private attribute options (and all user builder setters)
eplusminus Jan 1, 2018
5dd9a15
Update PHP version for Circle's Ubuntu 12.04 machine
arun251 Jan 3, 2018
551f104
Merge pull request #9 from eplusminus/eb/stop-on-401
arun251 Jan 3, 2018
159ca6c
Merge pull request #8 from eplusminus/eb/private-attrs
arun251 Jan 3, 2018
78d2dd2
Merge pull request #10 from eplusminus/php-5.3
arun251 Jan 3, 2018
6f0411a
Merge branch 'master' into php-5.3
eplusminus Jan 3, 2018
22324e8
Merge pull request #13 from eplusminus/php-5.3
arun251 Jan 3, 2018
2d65ada
Update branch to release 2.4.0
arun251 Jan 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
composer.phar
.vagrant
integration-tests/vendor
integration-tests/composer.lock
composer.lock
72 changes: 70 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,74 @@
# Change log

All notable changes to the LaunchDarkly Java SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
All notable changes to the LaunchDarkly PHP SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [2.4.0] - 2018-01-04
### Added
- Support for [private user attributes](https://docs.launchdarkly.com/docs/private-user-attributes).

### Changed
- Stop retrying HTTP requests if the API key has been invalidated.
- User bucketing supports integer attributes. Thanks @mlund01!
- Source code complies with the PSR-2 standard. Thanks @valerianpereira!

## [2.3.0] - 2017-10-06
### Added
- New `flush` method forces events to be published to the LaunchDarkly service. This can be useful if `LDClient` is not automatically destroyed at the end of a request. Thanks @foxted!

## [2.2.0] - 2017-06-06
### Added
- Support for [publishing events via ld-relay](README.md#using-ld-relay)
- Allow `EventPublisher` to be injected into the client.
- `GuzzleEventPublisher` as a synchronous, in-process alternative to publishing events via background processes.
- Allow the `curl` path used by `CurlEventPublisher` to be customized via the `curl` option to `LDClient`. Thanks @abacaphiliac!

## [2.1.2] - 2017-04-27
### Changed
- Added package suggestions in `composer.json`.

### Fixed
- Better handling of possibly null variations. Thanks @idirouhab!

## [2.1.1] - 2017-04-11
### Changed
- Better handling of possibly null targets. Thanks @idirouhab!
- Better handling of possibly null rules.

## [2.1.0] - 2017-03-23
### Changed
- Allow FeatureRequester to be injected into the client. Thanks @abacaphiliac!
- Allow Predis\Client to be overriden in LDDFeatureRequester. Thanks @abacaphiliac!
- Use logger interface method instead of Monolog method. Thanks @abacaphiliac!
- Improve type hinting for default. Thanks @jdrieghe!

## [2.0.7] - 2017-03-03
### Changed
- Removed warning when calling `allFlags` via `LDDFeatureRequester`
- Removed warning when a feature flag's prerequisites happen to be null

## [2.0.6] - 2017-02-07
### Changed
- Use minimum versions in composer.json

## [2.0.5] - 2017-02-03
### Changed
- Made Monolog dependency version less strict

## [2.0.4] - 2017-01-26
### Changed
- Made Composer requirements less strict

## [2.0.3] - 2017-01-05
### Changed
- Fixed botched 2.0.2 release: Better handling of null vs false when evaluating.

## [2.0.2] - 2017-01-04
### Changed
- Better handling of null vs false when evaluating.

## [2.0.1] - 2016-11-09
### Added
- Monolog is now a required dependency

## [2.0.0] - 2016-08-08
### Added
Expand All @@ -15,4 +83,4 @@ All notable changes to the LaunchDarkly Java SDK will be documented in this file
- The `toggle` call has been deprecated in favor of `variation`.

### Removed
- The `getFlag` function has been removed.
- The `getFlag` function has been removed.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ We encourage pull-requests and other contributions from the community. We've als
This can help with getting php 5.3 on your mac: https://github.com/Homebrew/homebrew-php

To see composer dependency graph:
`php composer.phar show -i -t`
`php composer.phar show -i -t`
95 changes: 61 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ LaunchDarkly SDK for PHP

[![Circle CI](https://circleci.com/gh/launchdarkly/php-client.svg?style=svg)](https://circleci.com/gh/launchdarkly/php-client)

Requirements
------------
1. PHP 5.3 or higher.

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

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

php composer.phar require launchdarkly/launchdarkly-php
php composer.phar require "guzzlehttp/guzzle:6.2.1"
php composer.phar require "kevinrob/guzzle-cache-middleware": "1.4.1"
php composer.phar require "guzzle/guzzle:dev-master#ecb935d2d0ecd8cddae4dcfb90515cac5e2cb023"

1. After installing, require Composer's autoloader:

require 'vendor/autoload.php';

2. Create a new LDClient with your SDK key:
1. Create a new LDClient with your SDK key:

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

Expand All @@ -39,42 +42,66 @@ Your first feature flag
Fetching flags
--------------

There are two approaches to fetching the flag rules from LaunchDarkly:
There are two distinct methods of integrating LaunchDarkly in a PHP environment.

* [Guzzle](https://github.com/launchdarkly/guzzle3) with its [cache plugin](https://github.com/launchdarkly/guzzle3/blob/master/docs/plugins/cache-plugin.rst) to request and cache HTTP responses in an in-memory array (default) -- note, this is a forked older version of Guzzle for PHP 5.3 compatibility
* [ld-relay](https://github.com/launchdarkly/ld-relay) to retrieve and store flags in Redis (recommended)

* Making HTTP requests (using Guzzle)
* Setting up the [ld-daemon](https://github.com/launchdarkly/ld-daemon) to store the flags in Redis
We strongly recommend using the ld-relay. Per-flag caching (Guzzle method) is only intended for low-throughput environments.

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

To use Guzzle it must be required as a dependency:
Require Guzzle as a dependency:

php composer.phar require "guzzlehttp/guzzle:6.2.1"
php composer.phar require "kevinrob/guzzle-cache-middleware": "1.4.1"
php composer.phar require "guzzle/guzzle:dev-master#ecb935d2d0ecd8cddae4dcfb90515cac5e2cb023"

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

Using Redis
===========
With Guzzle, you could persist your cache somewhere other than the default in-memory store, like Memcached or Redis. You could then specify your cache when initializing the client with the [cache option](https://github.com/launchdarkly/php-client/blob/master/src/LaunchDarkly/LDClient.php#L44).

1. Require Predis as a dependency:
$client = new LaunchDarkly\LDClient("YOUR_SDK_KEY", array("cache_storage" => $cacheStorage));

php composer.phar require "predis/predis:1.0.*"
Using LD-Relay
==============

2. Create the LDClient with the Redis feature requester as an option:
The LaunchDarkly Relay Proxy ([ld-relay](https://github.com/launchdarkly/ld-relay)) consumes the LaunchDarkly streaming API and can update
a Redis cache operating in your production environment. The ld-relay offers many benefits such as performance and feature flag consistency. With PHP applications, we strongly recommend setting up ld-relay with a Redis store.

$client = new LaunchDarkly\LDClient("your_sdk_key", ['feature_requester_class' => 'LaunchDarkly\LDDFeatureRequester']);
1. Set up ld-relay in [daemon-mode](https://github.com/launchdarkly/ld-relay#redis-storage-and-daemon-mode) with Redis

Learn more
-----------
2. Require Predis as a dependency:

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).
php composer.phar require "predis/predis:1.0.*"

3. Create the LDClient with the Redis feature requester as an option:

$client = new LaunchDarkly\LDClient("your_sdk_key", [
'feature_requester_class' => 'LaunchDarkly\LDDFeatureRequester',
'redis_host' => 'your.redis.host',
'redis_port' => 6379
]);

4. If ld-relay is configured for [event forwarding](https://github.com/launchdarkly/ld-relay#event-forwarding), you can configure the LDClient to publish events to ld-relay instead of directly to `events.launchdarkly.com`. Using `GuzzleEventPublisher` with ld-relay event forwarding can be an efficient alternative to the default `curl`-based event publishing.

$client = new LaunchDarkly\LDClient("your_sdk_key", [
'event_publisher_class' => 'LaunchDarkly\GuzzleEventPublisher',
'events_uri' => 'http://your-ldrelay-host:8030',
'feature_requester_class' => 'LaunchDarkly\LDDFeatureRequester',
'redis_host' => 'your.redis.host',
'redis_port' => 6379
]);

Testing
-------

We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all behave correctly.

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
------------

Expand All @@ -90,19 +117,19 @@ About LaunchDarkly
* 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] (http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
* [PHP] (http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
* [Python] (http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
* [Go] (http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
* [Node.JS] (http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
* [.NET] (http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
* [Ruby] (http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
* [Python Twisted] (http://docs.launchdarkly.com/docs/python-twisted "LaunchDarkly Python Twisted SDK")
* [JavaScript](http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
* [PHP](http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
* [Python](http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
* [Python Twisted](http://docs.launchdarkly.com/docs/python-twisted-sdk-reference "LaunchDarkly Python Twisted SDK")
* [Go](http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
* [Node.JS](http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
* [.NET](http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
* [Ruby](http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
* [iOS](http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK")
* [Android](http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK")
* Explore LaunchDarkly
* [www.launchdarkly.com] (http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
* [docs.launchdarkly.com] (http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
* [apidocs.launchdarkly.com] (http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
* [blog.launchdarkly.com] (http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates



* [launchdarkly.com](http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
* [docs.launchdarkly.com](http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
* [apidocs.launchdarkly.com](http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
* [blog.launchdarkly.com](http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.4.0
7 changes: 6 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
machine:
php:
version: 5.3.25
services:
- redis
- docker

test:
override:
# syntax check php files
- find ./src -name "*.php" -type f -print0 | xargs -0 -I {} php -l {}
- find ./tests -name "*.php" -type f -print0 | xargs -0 -I {} php -l {}
- vendor/bin/phpunit tests

- vendor/bin/phpunit tests --coverage-text
- vendor/bin/phpunit integration-tests/LDDFeatureRequesterTest.php
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
}
],
"require": {
"monolog/monolog": "^1.6",
"php": "~5.3",
"guzzle/guzzle": "dev-master#ecb935d2d0ecd8cddae4dcfb90515cac5e2cb023",
"psr/log": "1.0.0",
"psr/log": "^1.0",
"justinrainbow/json-schema": "v1.6.0"
},
"require-dev": {
"phpunit/phpunit": "4.8.26",
"phpdocumentor/phpdocumentor": "2.*",
"predis/predis": "1.0.*",
"zendframework/zend-serializer": "2.4.*"
"guzzle/guzzle": "dev-master#ecb935d2d0ecd8cddae4dcfb90515cac5e2cb023",
"phpunit/phpunit": ">=4.8.26 <5.0",
"phpdocumentor/phpdocumentor": "^2.0",
"predis/predis": "^1.0"
},
"suggested": {
"monolog/monolog": "1.21.0",
"predis/predis": "1.0.*"
"guzzle/guzzle": "(^dev-master#ecb935d2d0ecd8cddae4dcfb90515cac5e2cb023) Required when using GuzzleEventPublisher or the default FeatureRequester",
"predis/predis": "(^1.0) Required when using LDDFeatureRequester"
},
"autoload": {
"psr-4": {
Expand Down
Loading