2017 © Pedro Peláez
 

library client

An API Client library for Tacit APIs

image

tacit/client

An API Client library for Tacit APIs

  • Tuesday, January 12, 2016
  • by opengeek
  • Repository
  • 2 Watchers
  • 0 Stars
  • 65 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Tacit Client

The Tacit Client project is a library for using RESTful APIs created with Tacit within a Slim web application., (*1)

Installation

Use composer to require the tacit\client project., (*2)

user@host:~$ composer require "tacit/client dev-master"

Usage

In your gateway PHP file for the application, add the Identities provider and API Client as singletons to the DI container:, (*3)

$app->container->singleton('identities', function() use ($app) {
    return (new \Tacit\Client\Identity($app->config('api.identities')));
});

$app->container->singleton('api', function() use ($app) {
    return (new \Tacit\Client($app, $app->config('api.endpoint')));
});

Then add the Session Middleware to the application:, (*4)

session_name($app->config('session.name'));
session_set_cookie_params(
    (integer)$app->config('session.lifetime'),
    rtrim($app->request->getRootUri(), '/') . '/'
);

$app->add(new \Tacit\Middleware\Session());

The Versions

12/01 2016