uncgits/webex-api-wrapper-laravel 问题修复 & 功能扩展

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

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

uncgits/webex-api-wrapper-laravel

Composer 安装命令:

composer require uncgits/webex-api-wrapper-laravel

包简介

Laravel Wrapper for WebEx API PHP Library

README 文档

README

Contact: matt.libera@uncg.edu

Introduction

This package is a Laravel wrapper for the UNCG WebEx API PHP Library package, so that the WebEx API PHP Library can be used in Laravel apps.

This is a work in progress. Not recommend for production apps just yet.

Installation

  1. composer require 'uncgits/webex-api-wrapper-laravel'
  2. IF running Laravel 5.4 or below: Add Uncgits\WebexApiLaravel\ServiceProvider::class, to your config/app.php file
  3. Run php artisan vendor:publish --provider='Uncgits\WebexApiLaravel\ServiceProvider' - to publish the webex-api.php config file
  4. Set your environment credentials in your .env file, and set your configuration options in config/webex-api.php

Note: do not use protocols (http:// or https://) for WEBEX_API_XML_HOST or WEBEX_API_NBR_HOST

WEBEX_API_XML_HOST=
WEBEX_API_NBR_HOST=

WEBEX_API_USERNAME=
WEBEX_API_PASSWORD=
WEBEX_API_SITE_NAME=
WEBEX_API_PARTNER_ID=

Dependencies

This package has dependencies on uncgits/webex-api-php-library and barryvdh/laravel-debugbar (dev)

Usage

Basic Usage / Getting Started

In your code, assuming you've set your information/credentials properly in your .env file, you should be able to instantiate the Uncgits\WebexApiLaravel\WebexApi class, and then use any of its available methods (inherited from Uncgits\WebexApi\WebexApi) to make an API call.

Configuration options

History Days

You can add the WEBEX_API_HISTORY_DAYS=x option in your .env file to extend the timeframe in which the historical API calls are made (e.g. to fetch session and recording data) to x days. Bear in mind that WebEx pulls at most 500 records at a time from most of its history endpoints, so if your WebEx site sees regular heavy use, it may be impractical to set this to more than 30 (default). Recordings are also not retrievable past 28 days, per Cisco's documentation.

Notification Mode

There are two notification options built into this library. You may flash the information on the screen as a flash message, or log it in the Laravel logs (whatever you've got set).

In the config/webex-api.php file, notification_mode is an array. Inside, add one or both of flash and log.

If you choose to roll this into a higher-level custom notification / logging system for your app, you can leave this array empty to disable both of these methods, and then handle your own logging based on the return array from the API call (the API class returns the entire response, including response code, from every call).

As of version 0.7, no flash messaging package is included. You are free to install your own - recommend laracasts/flash or something that implements a similar API.

Throwing Exceptions

You can decide whether the library throws Exceptions on a failed API call, or simply returns the status and details in the response array. By default the library will throw Exceptions (WebexApiException class) when there is a failure in the API call, with the resulting response array being available via the exception's getResponse() method. You can turn this off if you do not want Exceptions to be thrown on error.

You can change this behavior by either editing the configuration file manually or adding the WEBEX_API_THROW_EXCEPTIONS variable to your .env file and setting it to a non-truthy value (false, 0, etc.).

Debug Mode

Requires DebugBar by Barryvdh (barryvdh\laravel-debugbar)

If you turn on Debug Mode in the config/webex-api.php file, extra information about the call will be written to the Debugbar. This includes timing, hashed cache key, and full results from each call.

> Note: in accordance with best practices for this package, this will only work if the app environment is not set to production

Caching

For speed, adherence to rate limits, and overall performance, caching is built into this library. This utilizes the Laravel Cache mechanism (which, like Logs, can be set however you want in the Laravel config). You can optionally disable this by adding WEBEX_API_CACHING=off in your .env file.

Cache TTL

The TTL of the cache is set to 10 minutes by default, but by adding WEBEX_API_CACHE_MINUTES=x to your .env file, you can set the cache to expire after x minutes.

Cached endpoints

Caching is performed only for specific endpoints (e.g. requests that would equate to typical GET requests). Obviously, you would not want to cache requests that are designed to actually modify information in WebEx (equivalent to POST or PATCH or DELETE requests).

By default, there is a basic set of endpoints set up in config/webex-api.php. If you would like change which endpoints are / are not cached (or add your own), simply modify the cached_endpoints array in the config file.

Version History

0.8.1

  • change to PSR-4 declaration since we were already following it

0.8

  • Fixes config keys for HTTP proxy

NOTE: if upgrading, make sure you add the new config keys into your webex-api.php config file, and set them in your .env file if using a proxy.

0.7.1

  • Change env() calls to config() calls so that config caching can be used.

0.7

  • Removes standaniels/flash as a dependency. Optional to install a flash package.

0.6.2

  • Fixes for IsActiveWebexUser rule: correct return array key, and handling of Exceptions.

0.6.1

  • catch all exceptions during xmlApiCall() so that we don't get to the caching step when we've got an exception at all.

0.6

  • delegating the exception to the base API library instead of the wrapper class - that way we can use try-catch in base API calls for situations where we expect failure (e.g. searching for a session by number without knowing what platform is being used)
  • no more option to turn off exception throwing

0.5.2

  • bugfix for missing semicolon. (hooray for impatience.)

0.5.1

  • Support for Laravel 5.8 (cache TTL handling - now using now()->addMinutes() when setting Cache item TTL)

0.5

  • add exception throwing by default, with option to turn off
  • requires v 0.5 of the API Library package

0.4

  • Nothing special

0.3.1

  • rework hashed cache key to allow for custom prepend/append values

0.3

  • updates cache to use $xmlHost (for multi-environment configs)
  • updates dependency on webex-api-php-library to ^0.3

0.2.3

  • Laravel 5.5+ auto discovery

0.2.2

  • updates dependency on webex-api-php-library to ^0.2

0.2.1

  • fixes a few other lingering effects from the months > days transition

0.2

  • changing history months to history days

0.1.2

  • bugfix for using proxy

0.1.1

  • bugfix for getPastSessions()

0.1

  • First real release.
  • .env integration for WebEx credentials
  • History months setting
  • Debug mode
  • Caching

uncgits/webex-api-wrapper-laravel 适用场景与选型建议

uncgits/webex-api-wrapper-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 354 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 07 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「api」 「laravel」 「webex」 「uncg」 「uncgits」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 uncgits/webex-api-wrapper-laravel 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-07-03