PHP code example of treehouselabs / keystone-client
1. Go to this page and download the library: Download treehouselabs/keystone-client library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
treehouselabs / keystone-client example snippets
use TreeHouse\Cache\CacheInterface;
use TreeHouse\Keystone\Client\ClientFactory;
use TreeHouse\Keystone\Client\Model\Tenant;
$tokenUrl = 'http://example.org/tokens';
$username = 'acme';
$password = 's3cr4t';
$serviceType = 'compute';
$serviceName = 'api';
// $cache is a TreeHouse\Cache\CacheInterface instance
$tenant = new Tenant($tokenUrl, $username, $password, $serviceType, $serviceName);
$client = (new ClientFactory($cache))->createClient($tenant);
// now just use $client as you would a regular Guzzle client
$response = $client->get('posts/');