Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/home/feature-management/edgedb/edge-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ For specific documentation on how to use Edge Flags with each SDK
- [Go SDK](/sdk/server-side-sdks/go#edgedb)
- [Java SDK](/sdk/server-side-sdks/java-cloud#edgedb)
- [Node.js SDK](/sdk/server-side-sdks/node#edgedb)
- [PHP SDK](/sdk/server-side-sdks/php#edgedb)
- [PHP SDK](/sdk/server-side-sdks/php/php-usage#edgedb)
- [Python SDK](/sdk/server-side-sdks/python#edgedb)
- [Ruby SDK](/sdk/server-side-sdks/ruby#edgedb)
- [.NET SDK for Cloud Bucketing](/sdk/server-side-sdks/dotnet-cloud#edgedb)
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/example-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Welcome to the Samples & Example Apps page, which showcases example applications
| [Java (Local Bucketing)](https://github.com/DevCycleHQ/java-server-sdk) | [Java (Local Bucketing) Reference Docs](/sdk/server-side-sdks/java-local.md) |
| [Javascript](https://github.com/DevCycleHQ/js-sdks/tree/main/sdk/js) | [Javascript Reference Docs](/sdk/client-side-sdks/javascript/javascript.md) |
| [NodeJS](https://github.com/DevCycleHQ/js-sdks/tree/main/sdk/nodejs) | [NodeJS Reference Docs](/sdk/server-side-sdks/node.md) |
| [PHP](https://github.com/DevCycleHQ/php-server-sdk) | [PHP Reference Docs](/sdk/server-side-sdks/php.md) |
| [PHP](https://github.com/DevCycleHQ/php-server-sdk) | [PHP Reference Docs](/sdk/server-side-sdks/php/php.md) |
| [Python](https://github.com/DevCycleHQ/python-server-sdk) | [Python Reference Docs](/sdk/server-side-sdks/python.md) |
| [React](https://github.com/DevCycleHQ/js-sdks/tree/main/examples/react) | [React Reference Docs](/sdk/client-side-sdks/react.md) |
| [React Native](https://github.com/DevCycleHQ/js-sdks/tree/main/examples/react/react-native-app) | [React Native Reference Docs](/sdk/client-side-sdks/react-native.md) |
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/features/all-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The DevCycle React SDK is built upon the JavaScript SDK. For more details, view

### [• Ruby SDK](/sdk/server-side-sdks/ruby#getting-all-features)

### [• PHP SDK](/sdk/server-side-sdks/php#getting-all-features)
### [• PHP SDK](/sdk/server-side-sdks/php/php-usage#getting-all-features)

### [• .NET / C# Cloud SDK](/sdk/server-side-sdks/dotnet-cloud#getting-all-features)

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/features/all-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The DevCycle React SDK is built upon the JavaScript SDK. For more details, view

### [• Ruby SDK](/sdk/server-side-sdks/ruby#getting-all-variables)

### [• PHP SDK](/sdk/server-side-sdks/php#getting-all-variables)
### [• PHP SDK](/sdk/server-side-sdks/php/php-usage#get-all-variables)

### [• .NET / C# Cloud SDK](/sdk/server-side-sdks/dotnet-cloud#getting-all-variables)

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/features/evaluating.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If there is an error reaching DevCycle, if the requested variable does not exist

### [• Ruby SDK](/sdk/server-side-sdks/ruby#get-and-use-variable-by-key)

### [• PHP SDK](/sdk/server-side-sdks/php#get-and-use-variable-by-key)
### [• PHP SDK](/sdk/server-side-sdks/php/php-usage#get-and-use-variable-by-key)

### [• Java Local SDK](/sdk/server-side-sdks/java-local#get-and-use-variable-by-key)

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/features/identify.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ As well, unlike the Client-Side SDKs, because Server-Side SDKs poll for project

### [• Ruby SDK](/sdk/server-side-sdks/ruby#user-object)

### [• PHP SDK](/sdk/server-side-sdks/php#user-object)
### [• PHP SDK](/sdk/server-side-sdks/php/php-usage#user-object)

### [• Java Local SDK](/sdk/server-side-sdks/java-local#user-object)

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/features/initialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If a variable is first read from the cache and has a listener for [realtime upda

### [• Ruby SDK](/sdk/server-side-sdks/ruby#installation)

### [• PHP SDK](/sdk/server-side-sdks/php#installation)
### [• PHP SDK](/sdk/server-side-sdks/php/php-install)

### [• Java Local SDK](/sdk/server-side-sdks/java-local#installation)

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/features/track.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The Track function in the DevCycle SDKs allows you to send up custom events whic

### [• Ruby SDK](/sdk/server-side-sdks/ruby#track-events)

### [• PHP SDK](/sdk/server-side-sdks/php#track-event)
### [• PHP SDK](/sdk/server-side-sdks/php/php-usage#track-event)

### [• Java Local SDK](/sdk/server-side-sdks/java-local#track-event)

Expand Down
2 changes: 2 additions & 0 deletions docs/sdk/server-side-sdks/php/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
position: 2
collapsed: true
34 changes: 34 additions & 0 deletions docs/sdk/server-side-sdks/php/php-gettingstarted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: DevCycle PHP Server SDK Getting Started
sidebar_label: Getting Started
sidebar_position: 2
---


Please follow the [installation procedure](/sdk/server-side-sdks/php/php-install) and then run the following:

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: bearerAuth
$config = DevCycle\Configuration::getDefaultConfiguration()->setApiKey('Authorization', '<DVC_SERVER_SDK_KEY>');

$apiInstance = new DevCycle\Api\DVCClient(
$config,
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
);
$user_data = new \DevCycle\Model\UserData(array(
"user_id"=>"my-user"
)); // \DevCycle\Model\UserData

try {
$result = $apiInstance->allFeatures($user_data);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DVCClient->allFeatures: ', $e->getMessage(), PHP_EOL;
}

```
30 changes: 30 additions & 0 deletions docs/sdk/server-side-sdks/php/php-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: DevCycle PHP Server SDK Installation
sidebar_label: Installation
sidebar_position: 1
---

Requires PHP 7.3 and later.

## Composer Installation

To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:

```json
{
"require": {
"devcycle/php-server-sdk": "*"
}
}
```

Then run `composer install`

## Manual Installation

Download the files and include `autoload.php`:

```php
<?php
require_once('/path/to/DevCycle/vendor/autoload.php');
```
Original file line number Diff line number Diff line change
@@ -1,81 +1,12 @@
---
title: PHP SDK
sidebar_position: 2
title: DevCycle PHP Server SDK Usage
sidebar_label: Usage
sidebar_position: 3
---

# DevCycle PHP Server SDK
## User Object

Welcome to the the DevCycle PHP SDK, initially generated via the [DevCycle Bucketing API](/bucketing-api/#tag/devcycle).

The SDK is available as a package on Packagist. It is also open source and can be viewed on Github.

[![Packagist](https://badgen.net/packagist/v/devcycle/php-server-sdk/latest)](https://packagist.org/packages/devcycle/php-server-sdk)
[![GitHub](https://img.shields.io/github/stars/devcyclehq/php-server-sdk.svg?style=social&label=Star&maxAge=2592000)](https://github.com/DevCycleHQ/php-server-sdk)

## Requirements

PHP 7.3 and later.

## Installation

### Composer Installation

To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:

```json
{
"require": {
"devcycle/php-server-sdk": "*"
}
}
```

Then run `composer install`

### Manual Installation

Download the files and include `autoload.php`:

```php
<?php
require_once('/path/to/DevCycle/vendor/autoload.php');
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: bearerAuth
$config = DevCycle\Configuration::getDefaultConfiguration()->setApiKey('Authorization', '<DVC_SERVER_SDK_KEY>');

$apiInstance = new DevCycle\Api\DVCClient(
$config,
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
);
$user_data = new \DevCycle\Model\UserData(array(
"user_id"=>"my-user"
)); // \DevCycle\Model\UserData

try {
$result = $apiInstance->allFeatures($user_data);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DVCClient->allFeatures: ', $e->getMessage(), PHP_EOL;
}

```

## Usage

### User Object

The full user data must be passed into every method. The only required field is `user_id`.
The full user data must be passed into every method. The only required field is `user_id`.
The rest are optional and are used by the system for user segmentation into variables and features.

See the User model in the [PHP user model doc](https://github.com/DevCycleHQ/php-server-sdk/blob/main/lib/Model/UserData.php) for all accepted fields including custom fields.
Expand All @@ -87,7 +18,7 @@ See the User model in the [PHP user model doc](https://github.com/DevCycleHQ/php
)); // \DevCycle\Model\UserData
```

### Get and use Variable by key
## Get and use Variable by key
```php
try {
$result = $apiInstance->variable($user_data, "my-key", "default");
Expand All @@ -98,7 +29,7 @@ try {
```
See [getVariableByKey](/bucketing-api/#operation/getVariableByKey) on the Bucketing API for the variable response format.

### Get all Variables
## Get all Variables
```php
try {
$result = $apiInstance->allVariables($user_data);
Expand All @@ -109,7 +40,7 @@ try {
```
See [getVariables](/bucketing-api/#operation/getVariables) on the Bucketing API for the variable response format.

### Getting all Features
## Getting all Features
```php
try {
$result = $apiInstance->allFeatures($user_data);
Expand All @@ -120,7 +51,7 @@ try {
```
See [getFeatures](/bucketing-api/#operation/getFeatures) on the Bucketing API for the feature response format.

### Track Event
## Track Event
```php
$event_data = new \DevCycle\Model\Event(array(
"type"=>"my-event"
Expand All @@ -134,7 +65,7 @@ try {
}
```

### EdgeDB
## EdgeDB

EdgeDB allows you to save user data to our EdgeDB storage so that you don't have to pass in all the user data every time you identify a user. Read more about [EdgeDB](/home/feature-management/edgedb/what-is-edgedb).

Expand All @@ -161,8 +92,6 @@ Each method in the [Usage](#Usage) section has a corresponding asynchronous meth
});
```



## Models

### UserData
Expand Down Expand Up @@ -232,11 +161,3 @@ To run the tests, use:
composer install
vendor/bin/phpunit
```

#### About this package

This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `1.0.0`
- Package version: `1.0.3`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`
22 changes: 22 additions & 0 deletions docs/sdk/server-side-sdks/php/php.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: PHP SDK
---

# DevCycle PHP Server SDK

Welcome to the the DevCycle PHP SDK, initially generated via the [DevCycle Bucketing API](/bucketing-api/#tag/devcycle).

The SDK is available as a package on Packagist. It is also open source and can be viewed on Github.

[![Packagist](https://badgen.net/packagist/v/devcycle/php-server-sdk/latest)](https://packagist.org/packages/devcycle/php-server-sdk)
[![GitHub](https://img.shields.io/github/stars/devcyclehq/php-server-sdk.svg?style=social&label=Star&maxAge=2592000)](https://github.com/DevCycleHQ/php-server-sdk)



#### About this package

This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `1.0.0`
- Package version: `1.0.3`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`