Skip to content

Commit 876c202

Browse files
removed separate page and added trimmed content into the install page (#278)
* removed separate page and added trimmed content into the install page * fix tabs * Updated executable name * add note about changing default port
1 parent 82321fd commit 876c202

File tree

2 files changed

+50
-58
lines changed

2 files changed

+50
-58
lines changed

docs/sdk/server-side-sdks/php/php-install.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,54 @@ Download the files and include `autoload.php`:
3838
require_once('/path/to/DevCycle/vendor/autoload.php');
3939
```
4040

41+
## Local Bucketing Proxy
42+
43+
Due to complexities with the PHP application lifecycle and state management, local bucketing functionality requires a different approach compared to the other server SDKS.
44+
45+
To access this functionality in PHP, DevCycle provides a **proxy** process that can run alongside your PHP application or on a separate host in your environment. This proxy mimics the Cloud Bucketing API but provides for higher speed variable evaluations due to the reduction of network latency and config caching; all powered by DevCycle's high performance Go Server SDK.
46+
47+
The local bucketing proxy can be downloaded as a binary or package from here: https://github.com/DevCycleHQ/local-bucketing-proxy/releases
48+
49+
#### Proxy Configuration
50+
51+
Once the proxy is downloaded and installed, it can be configured via either environment variables or command line arguments. See the [README](https://github.com/DevCycleHQ/local-bucketing-proxy#options) for the configuration options.
52+
53+
At a minimum, you will need set the `DVC_LB_PROXY_SDK_KEY` environment variable to activate the proxy. This should be set to your SDK key for your PHP application.
54+
The rest of the values can be left unchanged for basic operation. This will default to starting an HTTP server on port **8080**. You can change the port with the `DVC_LB_PROXY_HTTP_PORT` environment variable.
55+
56+
57+
#### Running the Proxy
58+
59+
The proxy can be started by just executing the binary:
60+
61+
```bash
62+
63+
$ devcycle-local-bucketing-proxy
64+
65+
HTTP server started on port 8080
66+
67+
```
68+
69+
At this point the proxy is live and ready to accept requests from the PHP SDK.
70+
71+
##### OS Packaged Version
72+
If you have installed an OS packaged version of the proxy - the binary will be installed to `/usr/bin/devcycle-local-bucketing-proxy`.
73+
74+
You will need to configure a separate supervisor/orchestrator such as `systemd` or `upstart` if no you need to create a long-lived process.
75+
76+
#### PHP SDK Configuration
77+
Once the local bucketing proxy is up and running, you will need to update the configuration for your PHP SDK to point at the proxy host.
78+
79+
The default configuration of the proxy will start run at `localhost:8080` and the PHP SDK would be setup as follows:
80+
81+
```php
82+
$config = DevCycle\Configuration::getDefaultConfiguration()
83+
->setApiKey('Authorization', $_ENV["DVC_SERVER_SDK_KEY"])
84+
->setHost("http://localhost:8080");
85+
```
86+
87+
No other configuration is necessary. Ensure that the local bucketing proxy process is running before the PHP application makes a request to it.
88+
89+
90+
4191

docs/sdk/server-side-sdks/php/php-localbucketing.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)