The client should be able to hold several public/private key pairs, and not only one. Example on how it can be used:
<?php
$client = new ImboClient\Client('http://imbo', array(
'user1' => 'privatekey1',
'user2' => 'privatekey2'
));
All methods fetching URL's and adding images and such must get a new optional parameter, identifying which user we are performing the operation as:
<?php
$statusUrl = $client->getStatusUrl('user1');
$userUrl = $client->getUserUrl('user1');
$imagesUrl = $client->getImagesUrl('user1');
$imageUrl = $client->getImageUrl('imageidentifier', 'user1');
$metadataUrl = $client->getMetadataUrl('imageidentifier', 'user1');
$response = $client->addImage('/path/to/image.png', 'user1');
Would it be an idea to also handle the case where users use different sets of servers?
<?php
$client = new ImboClient\Client(array(
'user1' => array(
'privateKey' => 'secretKey',
'hosts' => array(
'http://imbo1',
),
),
'user2' => array(
'privateKey' => 'superSecretKey',
'hosts' => array(
'http://foobar1',
'http://foobar'2,
),
),
));