2017 © Pedro Peláez
 

application hub-client-php

image

perinatologie/hub-client-php

  • Friday, March 9, 2018
  • by joostfaassen
  • Repository
  • 1 Watchers
  • 1 Stars
  • 590 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 22 Versions
  • 4 % Grown

The README.md

Hub Client for PHP

Getting started

Install dependencies:

Get PHP dependencies using Composer, (*1)

composer install

Examples

Setup environment variables

Before running the examples, make sure the following environment variables have been configured:, (*2)

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., (*3)

Note, the v1 credentials are also used to access resources at providers for v1 security hashes., (*4)

You can use a .env file, by copying the .env.dist to .env and updating it with your credentials., (*5)

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., (*6)

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., (*7)

These are published by curl here:, (*8)

  • https://curl.haxx.se/docs/caextract.html

If needed, you can download new ca certificates from there, and put them in the root of this project., (*9)

License

MIT. Please refer to the included LICENSE.md file, (*10)

The Versions

09/03 2018

dev-master

9999999-dev https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

The Development Requires

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

09/03 2018

v1.9.0

1.9.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

The Development Requires

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

29/11 2017

v1.8.0

1.8.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

The Development Requires

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

25/03 2017

v1.7.1

1.7.1.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

The Development Requires

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

19/03 2017

v1.7.0

1.7.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

The Development Requires

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

11/01 2017

v1.6.3

1.6.3.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

11/01 2017

v1.6.2

1.6.2.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

21/10 2016

v1.6.1

1.6.1.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

21/10 2016

v1.6.0

1.6.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

22/09 2016

v1.5.2

1.5.2.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

11/08 2016

v1.5.1

1.5.1.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

07/08 2016

v1.5.0

1.5.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

07/08 2016

v1.4.0

1.4.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

07/08 2016

v1.3.0

1.3.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

07/08 2016

v1.2.2

1.2.2.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

06/08 2016

v1.2.1

1.2.1.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

06/08 2016

v1.2.0

1.2.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

07/06 2016

v1.1.3

1.1.3.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

07/06 2016

v1.1.2

1.1.2.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

29/05 2016

v1.1.1

1.1.1.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

24/02 2016

v1.1.0

1.1.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg

20/02 2016

v1.0.0

1.0.0.0 https://github.com/perinatologie/hub-client-php

  Sources   Download

MIT

The Requires

 

by Perinatologie Engineering

hub perinatologie verloskunde gynaecologie echoscopie kraamzorg