perinatologie/hub-client-php
Composer 安装命令:
composer require perinatologie/hub-client-php
包简介
README 文档
README
Getting started
Install dependencies:
Get PHP dependencies using Composer
composer install
Examples
Setup environment variables
Before running the examples, make sure the following environment variables have been configured:
export HUB_URL="http://127.0.0.1:8080" export HUB_V1_USERNAME=joe export HUB_V1_PASSWORD=secret export HUB_V3_USERNAME=joe export HUB_V3_PASSWORD=secret
Hub v1 and v3 use different authentication methods, therefor you can specify them separately.
Note, the v1 credentials are also used to access resources at providers for v1 security hashes.
You can use a .env file, by copying the .env.dist to .env and updating it
with your credentials.
Run the examples
php examples/v1/getdossierinfo.php {bsn}
php examples/v3/search.php client_bsn=987654321
Build the v4 API client
The v4 API Client authenticates itself with the Hub using a Json Web Token (JWT) which it obtains from UserBase. The username and password you usually use to authenticate with the Hub are used to authenticate with UserBase and obtain a JWT. Thereafter, the v4 client is used in the same way as the v3 client.
use Hub\Client\Exception\ClientCreationException; use Hub\Client\Exception\ResponseException; use Hub\Client\Factory\ApiClientFactory; require_once '/path/to/vendor/autoload.php'; $userbaseUrl = 'http://userbase.example.com/auth'; $hubUrl = 'http://hub.example.com'; $username = 'my-username'; $password = 'my-password'; $clientFactory = new ApiClientFactory($hubUrl); $clientFactory->setUserbaseJwtAuthenticatorUrl($userbaseUrl); try { $client = $clientFactory->createV4Client($username, $password); } catch (ClientCreationException $e) { // failed to create the client: probably failed to obtain a JWT echo $e->getMessage() . PHP_EOL; exit(); } try { $resources = $client->findResources(); } catch (ResponseException $e) { echo $e->getMessage() . PHP_EOL; exit(); } var_dump($resources);
cacert.pem
For Guzzle versions > 4, curl is used to verify remote SSL connections.
In order for this to work, you'll need to pass a verify key to guzzle, pointing to
a .pem file containing all trusted CA's.
These are published by curl here:
If needed, you can download new ca certificates from there, and put them in the root of this project.
License
MIT. Please refer to the included LICENSE.md file
perinatologie/hub-client-php 适用场景与选型建议
perinatologie/hub-client-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.02k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 02 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「hub」 「perinatologie」 「verloskunde」 「gynaecologie」 「echoscopie」 「kraamzorg」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 perinatologie/hub-client-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 perinatologie/hub-client-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 perinatologie/hub-client-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
GitHub for Robo Task Runner
Create extendible and maintainable applications by harnessing the power of pipelines.
Ydle Main Bundle
Data layer for integration hub
Postaffiliate module for integration hub
API for integration hub
统计信息
- 总下载量: 6.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-20