espadav8/phpflagr

0.1.0 2019-02-15 12:19 UTC

This package is auto-updated.

Last update: 2024-09-16 04:34:01 UTC


README

Flagr 是一个功能开关、A/B 测试和动态配置的微服务

此 PHP 包由 Swagger Codegen 项目自动生成

  • API 版本:1.0.0
  • 包版本:0.1.0
  • 构建包:io.swagger.codegen.languages.PhpClientCodegen

要求

PHP 5.5 及以上版本

安装与使用

Composer

要使用 Composer 安装绑定,请在 composer.json 中添加以下内容

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

请按照 安装过程 进行操作,然后运行以下命令

<?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;
}

?>

API 端点文档

所有 URI 都是相对于 https:///api/v1

模型文档

授权文档

所有端点均不需要授权。

作者