2017 © Pedro Peláez
 

library fotoweb-php-sdk

Fotoweb by fotoware.com PHP SDK

image

szeidler/fotoweb-php-sdk

Fotoweb by fotoware.com PHP SDK

  • Tuesday, December 12, 2017
  • by szeidler
  • Repository
  • 1 Watchers
  • 0 Stars
  • 89 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 13 % Grown

The README.md

Fotoweb by fotoware.com PHP SDK

Build Status, (*1)

Fotoweb PHP SDK utilizes guzzle-services for an easy integration with Fotoware's FotoWeb RESTful API., (*2)

Requirements

  • PHP 7.4 or greater
  • Composer
  • Guzzle

Installation

Add Fotoweb PHP SDK as a composer dependency., (*3)

composer require szeidler/fotoweb-php-sdk:^2.0, (*4)

Usage

Returns the asset representation based on the resource url of the asset., (*5)

use Fotoweb\FotowebClient;

// Using the legacy API code method.

$client = new FotowebClient([
    'baseUrl'  => 'https://demo.fotoware.com',
    'authType' => 'token',
    'apiToken' => 'yourapi token',
]);

// Using oAuth2 with client credentials (Web API)

$client = new FotowebClient([
    'baseUrl'  => 'https://demo.fotoware.com',
    'authType' => 'oauth2',
    'grantType' => 'client_credentials',
    'clientId' => 'your client id',
    'clientSecret' => 'your client secret',
    'persistenceProvider' => new \kamermans\OAuth2\Persistence\NullTokenPersistence(),
]);

// Using oAuth2 with authorization_code (Web API)
$client = new FotowebClient([
    'baseUrl'  => 'https://demo.fotoware.com',
    'authType' => 'oauth2',
    'grantType' => 'authorization_code',
    'codeVerifier' => 'PKCE code verifier',
    'redirectUri' => 'your oauth2 redirect callback',
    'clientId' => 'your client id',
    'clientSecret' => 'your client secret',
    'persistenceProvider' => new \kamermans\OAuth2\Persistence\NullTokenPersistence(),
]);

$href = '/fotoweb/archives/5013-Demo%20assets/Artwork/Coffee%20from%20DAM/240x400.jpg.info';
$asset = $client->getAsset(['href' => $href]);
print $asset->offsetGet('filesize');

Testing

This SDK includes PHPUnit as a composer require-dev. Copy the phpunit.xml.dist to phpunit.xml and fill in with your API testing credentials., (*6)

Note: Currently the SDK does not use mocked responses, but does actual API calls., (*7)

./vendor/bin/phpunit -c phpunit.xml, (*8)

Credits

Stephan Zeidler for Ramsalt Lab AS, (*9)

License

The MIT License (MIT), (*10)

The Versions

12/12 2017

dev-master

9999999-dev https://github.com/szeidler/fotoweb-php-sdk

Fotoweb by fotoware.com PHP SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Stephan Zeidler

dam fotoweb fotoware

12/12 2017

v1.0.1

1.0.1.0 https://github.com/szeidler/fotoweb-php-sdk

Fotoweb by fotoware.com PHP SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Stephan Zeidler

dam fotoweb fotoware

15/11 2017

v1.0.0

1.0.0.0 https://github.com/szeidler/fotoweb-php-sdk

Fotoweb by fotoware.com PHP SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Stephan Zeidler

dam fotoweb fotoware