定制 bureaupieper/storee-php-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

bureaupieper/storee-php-client

Composer 安装命令:

composer require bureaupieper/storee-php-client

包简介

Client for the Store-E REST API

README 文档

README

Store-E is a content(-as-a-service/repository) platform taking care of all your content management needs. Content is delivered through 'Hotspots' and 'Pages' which you can define. Published content comes along with every form of media, which is also delivered through-, automated and managed by Store-E. Bitmaps in multiple formats and resolutions(no restrictions), videos in H.264, MP4, OGV, documents, third party integrations, and much more.

This client enables you to connect your website, enterprise network or social media platforms to our content repository in a matter of hours.

This library supports PSR-3 logging and provides some extra functionality for Monolog. Caching is handled by Stash. HTTP abstraction is handled by Guzzle. You're free to provide your own for any of the dependencies.

Installation

Stand-alone

$ curl -sS https://getcomposer.org/installer | php
$ composer require bureaupieper/storee-client
$ ./vendor/bin/phpunit

Symfony users

See the BureauPieper/storee-php-client-bundle for easy integration!

Usage:

Create the configuration container

See the tree for all the possibilities. The container makes sure your provided options are conflict-free.

$config = new Config(['apikey' => '1234', 'platform' => 'yourplatform']);

Instantiate the client

$client = new Client($config, \GuzzleHttp\Client $client = null, AbstractDriver $cacheDriver = null, Logger $logger = null);

Create the intermediary request object, and fire away.

$req = Client\Request\Factory::create('profile');
$result = $client->request($req);
$req = Client\Request\Factory::create('content/list', [
    'hotspot' => 'my-hotspot'
    'page' => 'my-page',
]);
$result = $client->request($req);

Content items in a result set are wrapped by ContentResult.php to ease development.

HTTP

A plain GuzzleHttp instance is used by default, checkout Guzzle for more information.

  • getlastRequest doesnt work when passing your own client, feel free to add Bureaupieper\StoreeClientEffectiveUrlMiddleware to your own handler stack when passing a client as following:
$stack = GuzzleHttp\HandlerStack::create();
$effectiveUrlMiddleware = new Bureaupieper\StoreeClientEffectiveUrlMiddleware();
$stack->push(GuzzleHttp\Middleware::mapRequest($effectiveUrlMiddleware));
$client = new GuzzleHttp\Client([
    'handler' => $stack
]);

Caching

Enabled by default with a filesystem driver. See Stash for a wide variety of driver options if you need to setup memcache across multiple nodes for example.

Cache will be refreshed based on the Time-to-renew(ttr) setting, TTL is irrelevant. If the endpoint goes down the platform stays up.

PSR-3 Logging

Can be enabled, if no implementation is provided Monolog will be used with two RotatingFileHandlers. Both INFO and ERR will be be saved to $config['logs']['default_driver']['path'], but it is recommended to pass a monolog instance with some filesystem handlers and setup logrorate yourself.

The mail setup will only work with the default logger instance.

Documentation

W.I.P

Contact

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固