devcycle/php-server-sdk

Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs.

v1.0.5 2023-03-17 19:21 UTC

This package is auto-updated.

Last update: 2023-03-20 15:57:11 UTC


README

Welcome to the the DevCycle PHP SDK, initially generated via the DevCycle Bucketing API.

Requirements

PHP 7.3 and later.

Installation

Composer Installation

To install the bindings via Composer, add the following to composer.json:

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

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Getting Started

Please follow the installation procedure and then run the following:

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

// Configure API key authorization: bearerAuth
$config = DevCycle\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_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

To find usage documentation, visit our docs.