定制 2600hz/kazoo-php-sdk 二次开发

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

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

2600hz/kazoo-php-sdk

Composer 安装命令:

composer require 2600hz/kazoo-php-sdk

包简介

Description of project kazoo-php-sdk.

README 文档

README

A simple Object Oriented wrapper for Kazoo API, written with PHP5.

NOTICE: Master is no longer backward compatibile with version 1.x

The master brach of this repo represents a new approach to the SDK, which will become version 2.x.

If you are currently using the SDK the 1.x branches will be maintained until otherwise notified.

Features

  • Follows PSR-0 conventions and coding standard: autoload friendly
  • Light and fast thanks to lazy loading of API classes
  • Extensively tested and documented

Requirements

Dependencies for the SDK are managed using Composer. For your convience we have included the composer binary in the root directory of the project.

However, if you would like to install Composer to your local system you can run (optional):

$ curl -s http://getcomposer.org/installer | php

Installing the SDK

NOTICE: These instructions are a work-in-progress. Do you have a better way? Let us know!

  • Browse to the GitHub repo for the Kazoo SDK and select the branch which represents the version you wish to use.
  • Click "Download ZIP"
  • Unzip the SDK into your project
  • The SDK follows the PSR-0 convention names for its classes, which means you should be able to easily integrate kazoo-php-sdk class loading in your own autoloader.

Installing the SDK (with Composer)

This assumes basic familiarization with composer. If you have not used Composer before you might read the getting started guide.

Add the following require line:

"2600hz/kazoo-php-sdk": "dev-master"

Using Composer update or install your project dependencies.

If your project is already including the auto-generated autloader, then you are done!

Example Usage

In this example we will find all admins of the account belonging to the authenticated user. It will then set "require_password_update" to true for each admin and save it back to the db.

<?php

/* Install the library via composer or download the .zip file to your project folder. */
/* This line loads the library */
require_once "vendor/autoload.php";

/* Setup your SDK options, most commonly the Kazoo URL. If not provided defaults to localhost */
$options = array('base_url' => 'http://kazoo-crossbar-url:8000');

/* Get an authentication token using ONE of the provided methods */
// $authToken = new \Kazoo\AuthToken\None(); /* must have IP auth enabled on Kazoo */
// $authToken = new \Kazoo\AuthToken\ApiKey('XXXXX');
$authToken = new \Kazoo\AuthToken\User('username', 'password', 'sip.realm');

$sdk = new \Kazoo\SDK($authToken, $options);

$filter = array('filter_priv_level' => 'admin');
$users = $sdk->Account()->Users($filter);
foreach ($users as $element) {
    $admin = $element->fetch();
    $admin->require_password_update = true;
    $admin->save();
}

This is a basic example, from $sdk object you can access the full power of Kazoo!

Check out the examples for more!

To see the lastest Unit testing and great examples of functions that were tested, see:

/kazoo-php-sdk/lib/hz2600/Kazoo/Tests/Functional

We need your help with version 2.x

  • Version 2.x of the SDK needs to have the Entity and Collection classes for each Kazoo API built, with unit tests
  • We need to create documentation
  • We need testers!

Interested? Heres how to get started!

  • Install your favorite webserver with PHP 5.3.2+
  • Clone the SDK from your fork to your webserver directory, in this example we will use:
$ cd /var/www/html/
$ git clone git@github.com:{YOUR_GITHUB_ORGANIZATION}/kazoo-php-sdk.git
  • Create a new branch for your changes
$ git branch -b MY-FEATURE-BRANCH
  • Make changes!
  • Commit the changes
$ git add .
$ git commit -m 'added the XXX API'
$ git push origin MY-FEATURE-BRANCH
  • Login to GitHub, and your should have a "Compare & pull request" button on fork. Follow the instructions provided by that tool!

Documentation

See the doc directory for more detailed documentation.

Credits

Contributors

Thanks to GitHub for the high quality API and documentation.

2600hz/kazoo-php-sdk 适用场景与选型建议

2600hz/kazoo-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.96k 次下载、GitHub Stars 达 19, 最近一次更新时间为 2013 年 12 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 2600hz/kazoo-php-sdk 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 9.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 17
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 19
  • Watchers: 43
  • Forks: 50
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-12-10