Skip to content

Commit 8c11cac

Browse files
authored
add README + CONTRIBUTING (#2)
1 parent 5b5f24f commit 8c11cac

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Change log
2+
3+
All notable changes to the project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
4+

CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contributing to this project
2+
3+
LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK.
4+
5+
## Submitting bug reports and feature requests
6+
7+
The LaunchDarkly SDK team monitors the [issue tracker](https://github.com/launchdarkly/php-server-sdk-redis-phpredis/issues) in this repository. Bug reports and feature requests specific to this SDK should be filed in this issue tracker. The SDK team will respond to all newly filed issues within two business days.
8+
9+
## Submitting pull requests
10+
11+
We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days.
12+
13+
## Build instructions
14+
15+
### Prerequisites
16+
17+
The project uses [Composer](https://getcomposer.org/) for managing dependencies.
18+
19+
### Installing dependencies
20+
21+
Run `composer install` or `php composer.phar install` (depending on how you have set up Composer) in the project root directory.
22+
23+
### Testing
24+
25+
To run all unit tests:
26+
27+
```
28+
./vendor/bin/phpunit
29+
```
30+
31+
The tests expect you to have Redis running locally on the default port, 6379. One way to do this is with Docker:
32+
33+
```
34+
docker run -p 6379:6379 redis
35+
```
36+
37+
Also, to run the tests, your PHP environment must include the `phpredis` extension. See https://github.com/phpredis/phpredis for how to install this.

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# LaunchDarkly Server-Side SDK for PHP - Redis integration with phpredis
2+
3+
[![CircleCI](https://circleci.com/gh/launchdarkly/php-server-sdk-redis-phpredis.svg?style=svg)](https://circleci.com/gh/launchdarkly/php-server-sdk-redis-phpredis)
4+
5+
This library provides a Redis-backed data source for the [LaunchDarkly PHP SDK](https://github.com/launchdarkly/php-server-sdk), replacing the default behavior of querying the LaunchDarkly service endpoints. The underlying Redis client implementation is the [`phpredis`](https://github.com/phpredis/phpredis) extension. If you want to use the Predis package instead, see https://github.com/launchdarkly/php-server-sdk-redis-predis.
6+
7+
The minimum version of the LaunchDarkly PHP SDK for use with this library is 4.0.0. In earlier versions of the SDK, the Redis integrations were bundled in the main SDK package.
8+
9+
The minimum PHP version is 7.3.
10+
11+
For more information, see [our SDK documentation](https://docs.launchdarkly.com/sdk/features/storing-data).
12+
13+
## Quick setup
14+
15+
This assumes that you have already installed the LaunchDarkly PHP SDK in your project.
16+
17+
1. Make sure the `phpredis` extension is installed in your PHP runtime environment.
18+
19+
2. Install this package with `composer`:
20+
21+
```shell
22+
php composer.phar install launchdarkly/server-sdk-redis-phpredis --save
23+
```
24+
25+
3. In your SDK configuration code, configure the Redis integration:
26+
27+
```php
28+
$fr = LaunchDarkly\Integrations\PHPRedis::featureRequester([
29+
"prefix" => "my-key-prefix"
30+
]);
31+
$config = [ "feature_requester" => $fr ];
32+
$client = new LDClient("sdk_key", $config);
33+
```
34+
35+
By default, the store will try to connect to a local Redis instance on port 6379. You may specify an alternate configuration as described in the API documentation for `PHPRedis::featureRequester`. Make sure the `prefix` option corresponds to the key prefix that is being used by the Relay Proxy.
36+
37+
## About LaunchDarkly
38+
39+
* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
40+
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
41+
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
42+
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
43+
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
44+
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
45+
* Explore LaunchDarkly
46+
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
47+
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
48+
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
49+
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates

0 commit comments

Comments
 (0)