dotzero / habrahabr_guzzle
此包已被废弃且不再维护。没有建议的替代包。
Habrahabr Api HTTP 适配器,使用 Http Guzzle
v0.1.0
2016-06-08 07:47 UTC
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: ~6.2
- tmtm/habrahabr_api: ~0.1
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is auto-updated.
Last update: 2022-06-04 08:46:15 UTC
README
安装
通过 composer 安装
$ composer require dotzero/habrahabr_guzzle
或添加到 composer.json 文件的 require
部分。
"dotzero/habrahabr_guzzle": "0.1.*"
require
快速开始
$adapter = new \Habrahabr\Api\HttpAdapter\GuzzleAdapter(); $adapter->setEndpoint(getenv('ENDPOINT')); $adapter->setToken(getenv('TOKEN')); $adapter->setClient(getenv('CLIENT')); $client = new \Habrahabr\Api\Client($adapter); $User = $client->getUserResource()->getUser('me'); var_dump($User);
测试
首先安装 --dev
依赖。然后运行
$ vendor/bin/phpunit
许可证
此库可在 MIT 许可证下使用: https://open-source.org.cn/licenses/mit-license.php