Skip to content

Commit 4d6dbbf

Browse files
mfahadahmedaliabbasrizvi
authored andcommitted
docs: Update readme for DFM (#181)
1 parent b9cdcc2 commit 4d6dbbf

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,44 @@ php composer.phar require optimizely/optimizely-sdk
2424
To access the Feature Management configuration in the Optimizely dashboard, please contact your Optimizely account executive.
2525

2626
### Using the SDK
27+
28+
#### Initialization
29+
Create the Optimizely client, for example:
30+
31+
```
32+
$optimizely = new Optimizely(<<DATAFILE>>);
33+
```
34+
35+
You can also provide an implementation of the `ProjectConfigManagerInterface` in the constructor:
36+
37+
```
38+
$configManager = new HTTPProjectConfigManager(<<SDK_KEY>>);
39+
$optimizely = new Optimizely(<<DATAFILE>>, null, null, null, false, $configManager);
40+
```
41+
42+
#### ProjectConfigManagerInterface
43+
[`ProjectConfigManagerInterface`](https://github.com/optimizely/php-sdk/blob/master/src/Optimizely/ProjectConfigManager/ProjectConfigManagerInterface.php) exposes `getConfig` method for retrieving `ProjectConfig` instance.
44+
45+
#### HTTPProjectConfigManager
46+
47+
[`HTTPProjectConfigManager`](https://github.com/optimizely/php-sdk/blob/master/src/Optimizely/ProjectConfigManager/HTTPProjectConfigManager.php)
48+
is an implementation of `ProjectConfigManagerInterface` interface.
49+
50+
The `fetch` method makes a blocking HTTP GET request to the configured URL to download the
51+
project datafile and initialize an instance of the ProjectConfig.
52+
53+
Calling `fetch` will update the internal ProjectConfig instance that will be returned by `getConfig`.
54+
55+
##### Use HTTPProjectConfigManager
56+
57+
```
58+
$configManager = new HTTPProjectConfigManager(<<SDK_KEY>>);
59+
```
60+
61+
##### SDK key
62+
Optimizely project SDK key; required unless source URL is overridden.
63+
64+
#### Documentation
2765
See the Optimizely Full Stack [developer documentation](https://developers.optimizely.com/x/solutions/sdks/reference/?language=php) to learn how to set up your first Full Stack project and use the SDK.
2866

2967
## Development

0 commit comments

Comments
 (0)