eleven-labs/api-service-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

eleven-labs/api-service-bundle

Composer 安装命令:

composer require eleven-labs/api-service-bundle

包简介

Integrate API Service into Symfony

README 文档

README

Build Status Code Coverage Scrutinizer Quality Score

This bundle integrate the API Service Component into Symfony.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

composer require eleven-labs/api-service-bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new ElevenLabs\ApiServiceBundle\ApiServiceBundle(),
        );
        // ...
    }
}

Config

Full configuration provided by the bundle:

api_service:
  # (optional)
  default_services:
    client: httplug.client
    message_factory: httplug.message_factory
    uri_factory: httplug.uri_factory
  # (optional) cache schema files
  cache:
    # provide the Id of any PSR-6 cache service
    service: 'my_app.cache'
  # (optional) configure supported pagination providers
  pagination:
    # extract pagination from response headers
    header:
      page: X-Page
      perPage: X-Per-Page
      totalPages: X-Total-Pages
      totalItems: X-Total-Items
  # configure api services
  apis:
    my_service:
      # the schema describing your api
      schema: 'file://%kernel.root_dir%/config/schema/foo.yml'
      # (optional) use a specific http client implementation
      client: httplug.client.foo
      # (optional) fine tune your api service
      config:
        # provide a base url
        baseUri: https://bar.com
        # validate request
        validateRequest: true
        # validate response
        validateResponse: false
        # return a psr-7 response
        # by default it return a `Resource` class
        returnResponse: false

Dependencies

HTTP client

The Api Service component make use of the Http\Client\HttpClient interface provided by HttPlug to send requests.

You can use your own HTTP client services within Symfony, but we strongly advice you to use the HttplugBundle

composer require php-http/httplug-bundle

You can then choose one the many HTTP client adapter supported by HTTPlug. A list is available here

# for example, here we choose the Guzzle 6 adapter
composer require php-http/guzzle6-adapter

Cache

This bundle have the ability to cache schema files used by you API services.
It use the PSR-6: Caching Interface to do so.

For performance reasons, the cache SHOULD be enable in production.

From Symfony 3.1 and above

Symfony 3.1 provide a cache implementation of the PSR-6 Caching Interface. You don't need additional components to integrate caching capabilities to the framework.

From Symfony 2.7 to 3.1

We recommend you to use the PSR-6 Cache adapter Bundle.

You can then choose one of the many cache pool implementations provided by the php-cache organization.

eleven-labs/api-service-bundle 适用场景与选型建议

eleven-labs/api-service-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 227 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 08 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 eleven-labs/api-service-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 eleven-labs/api-service-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 eleven-labs/api-service-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-04