2017 © Pedro Peláez
 

library onehydra

A library for working with the OneHydra API

image

amara/onehydra

A library for working with the OneHydra API

  • Friday, December 8, 2017
  • by rossmotley
  • Repository
  • 6 Watchers
  • 2 Stars
  • 7,149 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 12 % Grown

The README.md

amara/onehydra

Build Status Coverage Status, (*1)

Purpose

amara/onehydra is a library for working with the OneHydra API from PHP, it's still in development so will change often., (*2)

Installation

Use composer:, (*3)

composer require amara/onehydra

Example usage

The library should be extensible for you:, (*4)

use Amara\OneHydra\Api;
use Amara\OneHydra\Http\HttpRequestBuilder;
use Amara\OneHydra\Http\Transport\GuzzleTransport;
use Amara\OneHydra\ResultBuilder\ResultBuilderEngine;
use GuzzleHttp\Client;

$isUat = false;
$authToken = 'your auth token';

// Use the standard request builder
$httpRequestBuilder = new HttpRequestBuilder($isUat, $authToken);

// Create a Guzzle transport, in UAT you'll need to ignore the OneHydra SSL cert
$guzzleClient = new Client();
$transport = new GuzzleTransport($guzzleClient);

// Create the result builder engine, which will create result objects 
// for our requests
$resultBuilderEngine = new ResultBuilderEngine();

$api = new Api($httpRequestBuilder, $transport, $resultBuilderEngine);

Once we have the API, the interface makes it easy to work with:, (*5)

$pagesResult = $api->getPagesResult();

// Print the urls of the pages we will need to fetch details for
foreach ($pagesResult->getPageUrls() as $pageUrl) {
    echo $pageUrl;
}

We can then fetch the details for a particular page:, (*6)

$pageResult = $api->getPageResult('/my/page');
$pageLinks = $pageResult->getPage()->getLinks();

Versioning

The library will be following Semantic Versioning, although we don't have a 1.0.0 release yet!, (*7)

http://semver.org/spec/v2.0.0.html, (*8)

The Versions

08/12 2017

dev-master

9999999-dev

A library for working with the OneHydra API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vincenzo Trapani
by Ross Motley

08/12 2017

v0.4.1

0.4.1.0

A library for working with the OneHydra API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vincenzo Trapani
by Ross Motley

28/11 2017

v0.4.0

0.4.0.0

A library for working with the OneHydra API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vincenzo Trapani
by Ross Motley

13/07 2017

v0.3.0

0.3.0.0

A library for working with the OneHydra API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vincenzo Trapani
by Ross Motley

13/06 2016

v0.2.1

0.2.1.0

A library for working with the OneHydra API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vincenzo Trapani
by Ross Motley

13/06 2016

v0.2.0

0.2.0.0

A library for working with the OneHydra API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vincenzo Trapani
by Ross Motley

02/02 2016

v0.1.0

0.1.0.0

  Sources   Download

The Requires

 

by Vincenzo Trapani