Skip to content

opengeek/tacit-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tacit Client

The Tacit Client project is a library for using RESTful APIs created with Tacit within a Slim web application.

Installation

Use composer to require the tacit\client project.

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:

$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:

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());

About

Tacit API Client Package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages