Skip to content

EspadaV8/phpflagr

Repository files navigation

Flagr is a feature flagging, A/B testing and dynamic configuration microservice

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 0.1.0
  • Build package: io.swagger.codegen.languages.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/espadav8/phpflagr.git"
    }
  ],
  "require": {
    "espadav8/phpflagr": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

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

$apiInstance = new EspadaV8\PHPFlagr\Api\ConstraintApi(
    // 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()
);
$flagID = 789; // int | numeric ID of the flag
$segmentID = 789; // int | numeric ID of the segment
$body = new \EspadaV8\PHPFlagr\Model\CreateConstraintRequest(); // \EspadaV8\PHPFlagr\Model\CreateConstraintRequest | create a constraint

try {
    $result = $apiInstance->createConstraint($flagID, $segmentID, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConstraintApi->createConstraint: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to http://localhost/api/v1

Class Method HTTP request Description
ConstraintApi createConstraint POST /flags/{flagID}/segments/{segmentID}/constraints
ConstraintApi deleteConstraint DELETE /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
ConstraintApi findConstraints GET /flags/{flagID}/segments/{segmentID}/constraints
ConstraintApi putConstraint PUT /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
DistributionApi findDistributions GET /flags/{flagID}/segments/{segmentID}/distributions
DistributionApi putDistributions PUT /flags/{flagID}/segments/{segmentID}/distributions
EvaluationApi postEvaluation POST /evaluation
EvaluationApi postEvaluationBatch POST /evaluation/batch
FlagApi createFlag POST /flags
FlagApi deleteFlag DELETE /flags/{flagID}
FlagApi findFlags GET /flags
FlagApi getFlag GET /flags/{flagID}
FlagApi getFlagSnapshots GET /flags/{flagID}/snapshots
FlagApi putFlag PUT /flags/{flagID}
FlagApi setFlagEnabled PUT /flags/{flagID}/enabled
SegmentApi createSegment POST /flags/{flagID}/segments
SegmentApi deleteSegment DELETE /flags/{flagID}/segments/{segmentID}
SegmentApi findSegments GET /flags/{flagID}/segments
SegmentApi putSegment PUT /flags/{flagID}/segments/{segmentID}
SegmentApi putSegmentsReorder PUT /flags/{flagID}/segments/reorder
VariantApi createVariant POST /flags/{flagID}/variants
VariantApi deleteVariant DELETE /flags/{flagID}/variants/{variantID}
VariantApi findVariants GET /flags/{flagID}/variants
VariantApi putVariant PUT /flags/{flagID}/variants/{variantID}

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

About

PHP client for flagr

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages