livetyping / hermitage-php-client
Client for Hermitage servers
Installs: 5 046
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 3
Open Issues: 0
Requires
- php: >=5.5
- guzzlehttp/guzzle: ~6.2
- psr/http-message: ~1.0
Requires (Dev)
- phpro/grumphp: ~0.9
- squizlabs/php_codesniffer: ~2.3
This package is not auto-updated.
Last update: 2024-11-15 22:53:00 UTC
README
PHP Client for Hermitage.
Installation
Run the Composer command to install the latest version:
composer require livetyping/hermitage-php-client ~0.1
Usage
<?php use livetyping\hermitage\client\Client; use livetyping\hermitage\client\RequestSigner; use livetyping\hermitage\client\Signer; $secret = '<secret value>'; $baseUri = 'http://hermitage'; $signer = new RequestSigner(new Signer($secret)); $client = new Client($signer, new \GuzzleHttp\Client(), $baseUri); /** @var \Psr\Http\Message\ResponseInterface $response */ $response = $client->upload(file_get_contents('path/to/local/image')); $filename = json_decode((string)$response->getBody()); $filename = $filename['filename']; $response = $client->get($filename, '<version name>'); $response = $client->delete($filename); /** @var \Psr\Http\Message\UriInterface $uri */ $uri = $client->uriFor($filename, '<version name>');
License
Hermitage PHP Client is licensed under the MIT License.
See the LICENSE file for more information.