File tree Expand file tree Collapse file tree 4 files changed +754
-645
lines changed Expand file tree Collapse file tree 4 files changed +754
-645
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ Quick setup
11110 . 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
15171 . 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+
3768Learn more
3869-----------
3970
Original file line number Diff line number Diff line change 11machine :
22 php :
3- version : 5.4.37
3+ version : 5.5.21
44
55test :
66 override :
Original file line number Diff line number Diff line change 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" : {
You can’t perform that action at this time.
0 commit comments