activecollab/activecollab-sdk
Composer 安装命令:
composer require activecollab/activecollab-sdk
包简介
This is a simple PHP library that makes communication with activeCollab API easy
关键字:
README 文档
README
This is a simple PHP library that makes communication with activeCollab 4 API easy. If you are looking for a library that works with Active Collab 5 and newer, use this package instead.
First Connection
Pull down the latest tag (1.0.x) for the following example. The develop branch is not to be used with activeCollab 4.2.x!
In order to connect, you will need API URL and API token.
To get these details, go to your user profile in your activeCollab and select API Subscriptions from Options drop-down. Click on New Subscription button and fill the form (client name is name of your app that will communicate with activeCollab via API). After you create API subscription for your application, click on the magnifier glass icon to open a dialog that will show you API URL and token for that subscription.
Now that you have API token and URL, you can test out this simple example:
<?php require_once 'ActiveCollab/autoload.php'; use \ActiveCollab\Client as API; use \ActiveCollab\Connectors\Curl as CurlConnector; use \ActiveCollab\Exceptions\AppException; API::setUrl('MY-API-URL'); API::setKey('MY-API-TOKEN'); API::setConnector(new CurlConnector); print '<pre>'; print_r(API::info()); print '</pre>';
This example will contact activeCollab and ask for application and user info. Response is a simple associative array with a lot of details about the system that you are communicating with.
Using Composer
If you choose to install this application with composer instead of pulling down the git repository you will need to add a composer.json file to the location you would like to pull the repository down to featuring:
{
"require": {
"activecollab/activecollab-sdk": "1.0.*"
}
}
Run a composer update to install the package. To test the API add the following to a php file and run it.
<?php require_once 'vendor/autoload.php'; use \ActiveCollab\Client as API; use \ActiveCollab\Connectors\Curl as CurlConnector; use \ActiveCollab\Exceptions\AppException; API::setUrl('MY-API-URL'); API::setKey('MY-API-TOKEN'); API::setConnector(new CurlConnector); print '<pre>'; print_r(API::info()); print '</pre>';
Making API Calls
Listing all tasks in project #65 is easy. Just call:
API::call('projects/65/tasks');
This example shows how you can create a new task in a selected project:
try { API::call('projects/65/tasks/add', null, array( 'task[name]' => 'This is a task name', 'task[assignee_id]' => 48, 'task[other_assignees]' => array(3, 1), ), array( '/attach.jpeg' )); } catch(AppException $e) { print $e->getMessage() . '<br><br>'; // var_dump($e->getServerResponse()); (need more info?) } // try
call() method can take four parameters:
command(required) - API command,extra command parameters(optional) - Extra variables that will be attached to the command. Most commands don't require any extra command parameters, but some do (likedont_limit_resultparam for Tracked time and expenses listing command),POST variables- array of POST variables. Note that you do not need to addsubmittedvariable (it is automatically added for you),attachments- List of file paths that should be attached to the object that is being created or updated.
For full list of available API command, please check activeCollab API documentation.
activecollab/activecollab-sdk 适用场景与选型建议
activecollab/activecollab-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.12k 次下载、GitHub Stars 达 24, 最近一次更新时间为 2013 年 12 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「activecollab」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 activecollab/activecollab-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 activecollab/activecollab-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 activecollab/activecollab-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Library that enables easy persistance of objects to the MySQL 5.7+ database
Tag objects and collections using etag
Define database structure in PHP and let the library generate object classes and tables
Database schema migrations
Abstract interface for preparing orders and processing payments
Server side promises
统计信息
- 总下载量: 9.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-12-20