ghosh/designernews-php-api
Composer 安装命令:
composer require ghosh/designernews-php-api
包简介
A simple php wrapper for the Designer News API.
关键字:
README 文档
README
About
A simple php wrapper for the Designer News API.
Requirements
- PHP 5.3.x or higher
- cURL
- A valid Designer News Access Token
oAuth 2
This library assumes that you have already acquired a valid Access Token using your preferred oAuth library.
Please note that as of this writing, the Designer News API only supports ClientCredentials and Password Grant Types.
Getting Started
You can either download the latest version from the repo, or alternatively install it as a dependency with Composer.
Installing with Composer
{
"require": {
"ghosh/designernews-php-api": "~1.0"
}
}
Then run composer.phar install from your command line in your application root folder.
Instantiating the class
$config = array( "accessToken" => "YOUR_ACCESS_TOKEN" ); try { $DN = new DesignerNews($config); } catch (Exception $e) { echo $e->getMessage(); }
This creates a new instance of the Designer News API class and assigns it to the $DN handle. Its recommended to wrap this in a try/catch block to handle any errors that may arise.
Configuration Options
accessTokenRequired - This is the access token which would be provided to you by your oauth libraryapiVersionSegmentOptional - The current api version. Will default tov1userAgentOptional - The user agent for the application. Designer News recommends setting it to your email address so that you can be contacted if any misuse of data is detected. Defaults todesigner-news-api-php-wrapper
Available Methods
The wrapper includes convenient methods used to perform HTTP requests on behalf of the authenticated user. Below you will find a list of all available methods.
User
$DN->me();
Stories
$DN->getStory($id); $DN->upvoteStory($id); $DN->commentOnStory($id, $comment); $DN->getTopStories(); $DN->getRecentStories(); $DN->searchForStory($queryString);
Comments
$DN->getComment($id); $DN->upvoteComment($id); $DN->replyToComment($id, $reply);
MOTD (Message of the day)
$DN->getMOTD(); $DN->upvoteMOTD(); $DN->downvoteMOTD();
Response Type
All responses from the Designer News API PHP Wrapper are returned as PHP objects.
Feedback and Bugs
Feel free to open a new issue here on github for any bug you may have come across or a feature which you would like added. Pull requests are most welcomed.
History
Designer News 1.0
release- Initial Public Releasefeature- Added Packagist support
Designer News 0.1
release- Public Beta Release
ghosh/designernews-php-api 适用场景与选型建议
ghosh/designernews-php-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 18, 最近一次更新时间为 2014 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「Designer News」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ghosh/designernews-php-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ghosh/designernews-php-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ghosh/designernews-php-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Designer module for DVelum
workflow designer server
workflow designer
This is for third-party libraries used by Survloop which don't have an existing Packagist package.
Survloop is an open data engine for designing a database and creating a mobile-friendly user interfaces to fill it.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-03-10