contextio/php-contextio
最新稳定版本:3.2
Composer 安装命令:
composer require contextio/php-contextio
包简介
PHP Client Library for Context.IO API
关键字:
README 文档
README
Context.IO
Description
A PHP Client Library for Context.IO.
Requirements
PHP Curl (http://php.net/curl)
Install using Composer
You can install the library by adding it as a dependency to your composer.json.
"require": {
"contextio/php-contextio": ">=2.*"
}
Examples
// include Composer's autoloader include_once("vendor/autoload.php"); // define your API key and secret - find this https://console.context.io/#settings $apiKey = 'YOUR API KEY'; $apiSecret = 'YOUR API SECRET'; // many calls are based for an Account - you can define a ACCOUNT_ID to make these calls // the ACCOUNT_ID is returned in either the listAccounts call or the getAccount call // you can also get this from the interactive console $accountId = 'A CONTEXTIO ACCOUNT ID'; // instantiate the contextio object $contextio = new ContextIO\ContextIO($apiKey, $apiSecret); // get a list of accounts and print the response data out $response = $contextio->listAccounts(); print_r($response->getData()); // You also need to know the SOURCE_LABEL and FOLDER to list messages. $response = $contextio->listSources($accountId); print_r($response->getData()); // You can see all the folders in an email account using the listEmailAccountFolders method $label = 'A SOURCE LABEL'; $params = array('label'=> $label); $response = $contextio->listSourceFolders($accountId, $params); print_r($response); // Now that you know the ACCOUNT_ID, LABEL, and FOLDER you can list messages $folder = 'A FOLDER NAME'; $params = array('label'=> $label, 'folder'=> $folder); $response = $contextio->listMessagesBySourceAndFolder($accountId, $params); print_r($response); // It's a good idea to do error handling on your api calls. You can get the last error response // from the client, and then retry the call $x = 0; while($x < 10) { //retry the call up to 10 times if it fails $response = $contextio->listAccounts(); if($reponse != false) { print_r($response->getData()); break; } else { print_r($contextio->getLastRequest()->getLastResponse()); $x++; sleep(5); //don't retry immediately } } // You can set a request timeout, after which a ContextIO\cURLException will be thrown if // no response has been received from the API $contextio->getLastRequest()->setRequestTimeout(10);
All methods are listed in src/ContextIO/ContextIO.php
contextio/php-contextio 适用场景与选型建议
contextio/php-contextio 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 239.58k 次下载、GitHub Stars 达 70, 最近一次更新时间为 2013 年 01 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「imap」 「contextio」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 contextio/php-contextio 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 contextio/php-contextio 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 contextio/php-contextio 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP class to access an IMAP mailbox. Specifically uses the Laminas library and not the IMAP extension.
yii2 extension to read and process mails from IMAP and PHP
IMAP client for PHP without php-imap extension dependency
Laravel IMAP client
Laravel IMAP client
Php imap client
统计信息
- 总下载量: 239.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 70
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2013-01-11