承接 leaseweb/chefauth-guzzle-plugin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

leaseweb/chefauth-guzzle-plugin

最新稳定版本:2.1.0

Composer 安装命令:

composer require leaseweb/chefauth-guzzle-plugin

包简介

A guzzle plugin handling all authentication for Chef server API.

README 文档

README

A guzzle middleware handling all authentication for Chef server API.

requirements

  • PHP 7.0
  • Guzzle 7

installation

First you need Guzzle, offcourse.

Add the leaseweb/chefauth-guzzle-plugin as a dependency to your project:

$ php composer.phar require "leaseweb/chefauth-guzzle-plugin":"2.0.0"

Composer will install the plugin to your project's vendor/leaseweb directory.

You are now ready to use the plugin.

usage

Create a new guzzle client pointing to your chef server:

<?php
require_once 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Handler\CurlHandler;
use LeaseWeb\ChefGuzzle\Middleware\ChefAuthMiddleware;

$handler = new CurlHandler();

$stack = HandlerStack::create($handler);
$stack->push(new ChefAuthMiddleware('janedoe', 'path/to/key.pem'));

$client = new Client([
    'base_uri' => 'https://my.chef.server.com/organizations/acme',
    'handler' => $stack
]);

$environments = $client->get("/environments");

Read more about guzzle here http://docs.guzzlephp.org/en/stable/index.html

license

MIT

统计信息

  • 总下载量: 6.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 4
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-23