steveworley/lagoon-php-sdk

Lagoon GraphQL SDK for PHP

v1.5.0 2020-05-05 23:43 UTC

This package is auto-updated.

Last update: 2024-08-29 04:49:01 UTC


README

CircleCI

Lagoon SDK for PHP使得开发者可以轻松地将他们的应用程序连接到PHP代码中的Lagoon GraphQL服务。

入门指南

使用composer安装此包。

composer require steveworley/lagoon-php-sdk

定义$endpoint$token来创建一个新的客户端实例。

快速示例

获取所有项目

<?php

use Lagoon\LagoonClient;

$client = new LagoonClient($endpoint, $token);
$customers = $client->customer()->all()->execute();

获取所有项目名称

<?php

use Lagoon\LagoonClient;

$client = new LagoonClient($endpoint, $token);
$customers = $client->project()->all()->fields(['name'])->execute();

添加项目

<?php

use Lagoon\LagoonClient;

$client = new LagoonClient($endpoint, $token);
$project = [
  'name' => 'my-proejct',
  'customer' => 1,
  'openshift' => 1,
  'gitUrl' => 'git@github.com:test/test.git'
  'productEnvironment' => 'master',
  'branches' => 'master',
];
$customers = $client->project()->add($project)->execute();