承接 turanct/immutio 相关项目开发

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

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

turanct/immutio

最新稳定版本:1.0.0

Composer 安装命令:

composer require turanct/immutio

包简介

PHP api wrapper for immut.io

README 文档

README

A PHP wrapper for the immut.io API.

Usage

Installing it is easy, just require turanct/immutio as a dependency in your composer.json file. You'll also need one of the transports (e.g. BuzzTransport). If you use one of the existing transport packages, you should only require that package, it will include this one automatically.

{
    "require-dev": {
        "turanct/immutio": "dev-master"
    }
}

To create a blob on immut.io, do this:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$browser = new Buzz\Browser();
$transport = new Immutio\BuzzTransport($browser);
$client = new Immutio\Client($transport);

$blob = new Immutio\Blob(
    '{"ramsamsam": "bla", "foo": "bar", "baz": true, "qux": 1}',
    'application/json'
);

$blobId = $client->sendBlob($blob);
var_dump($blobId);

To retreive a blob, do this:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$browser = new Buzz\Browser();
$transport = new Immutio\BuzzTransport($browser);
$client = new Immutio\Client($transport);

$blob = $client->retrieveBlob($blobId);

Contributing

Feel free to fork and send pull requests!

License

This library is distributed under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

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