You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
0 commit comments