Skip to content

Commit 60c2561

Browse files
authored
Merge pull request #27 from richardmiller/make-guzzle-a-suggestion
Make Guzzle 5 a suggestion not a requirement
2 parents fdb4548 + a0a8ca4 commit 60c2561

File tree

4 files changed

+754
-645
lines changed

4 files changed

+754
-645
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Quick setup
1111
0. Install the PHP SDK with [Composer](https://getcomposer.org/)
1212

1313
php composer.phar require launchdarkly/launchdarkly-php
14+
php composer.phar require "guzzlehttp/guzzle:5.*"
15+
php composer.phar require "guzzlehttp/cache-subscriber:0.1.*"
1416

1517
1. After installing, require Composer's autoloader:
1618

@@ -34,6 +36,35 @@ Your first feature flag
3436
# the code to run if the feature is off
3537
}
3638

39+
Fetching flags
40+
--------------
41+
42+
There are two approaches to fetching the flag rules from LaunchDarkly:
43+
44+
* Making HTTP requests (using Guzzle)
45+
* Setting up the [ld-daemon](https://github.com/launchdarkly/ld-daemon) to store the flags in Redis
46+
47+
Using Guzzle
48+
============
49+
50+
To use Guzzle it must be required as a dependency:
51+
52+
php composer.phar require "guzzlehttp/guzzle:5.*"
53+
php composer.phar require "guzzlehttp/cache-subscriber:0.1.*"
54+
55+
It will then be used as the default way of fetching flags.
56+
57+
Using Redis
58+
===========
59+
60+
1. Require Predis as a dependency:
61+
62+
php composer.phar require "predis/predis:1.0.*"
63+
64+
2. Create the LDClient with the Redis feature requester as an option:
65+
66+
$client = new LaunchDarkly\LDClient("your_api_key", ['feature_requester_class' => 'LaunchDarkly\LDDFeatureRequester']);
67+
3768
Learn more
3869
-----------
3970

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
machine:
22
php:
3-
version: 5.4.37
3+
version: 5.5.21
44

55
test:
66
override:

composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@
1414
}
1515
],
1616
"require": {
17-
"php": ">=5.4",
18-
"guzzlehttp/guzzle": "5.*",
19-
"guzzlehttp/cache-subscriber": "0.1.*"
17+
"php": ">=5.5"
2018
},
2119
"require-dev": {
2220
"phpunit/phpunit": "4.3.*",
2321
"phpdocumentor/phpdocumentor": "2.*",
24-
"predis/predis": "1.0.*"
22+
"predis/predis": "1.0.*",
23+
"guzzlehttp/guzzle": "5.*",
24+
"guzzlehttp/cache-subscriber": "0.1.*",
25+
"zendframework/zend-serializer": "2.7.*"
2526
},
2627
"suggested": {
27-
"predis/predis": "1.0.*"
28+
"predis/predis": "1.0.*",
29+
"guzzlehttp/guzzle": "5.*",
30+
"guzzlehttp/cache-subscriber": "0.1.*"
2831
},
2932
"autoload": {
3033
"psr-4": {

0 commit comments

Comments
 (0)