The Comfortable PHP SDK can be installed with Composer. Run this command:
composer require comfortable/php-sdk
Note: This version of the SDK requires PHP 5.6 or greater.
<?php
require_once __DIR__ . '/vendor/autoload.php'; // change path as needed
use Comfortable;
$api = Comfortable\Api::connect('{repository-api-id}', '{api-key}');
try {
// get all documents stored in comfortable (default limit: 25)
$results = $api->getDocuments()->execute();
} catch (\RuntimeException $e) {
echo 'Comfortalbe SDK returned an error: ' . $e->getMessage();
exit;
}
Complete documentation, installation instructions, and examples are available here.
- Composer is a prerequisite for running the tests. Install composer globally, then run composer install to install required files.
- Create
phpunit.xml
fromphpunit.xml.dist
and edit it to add your credentials. Alternatively you can set your credentials as environment variables. For this you have to defineCMFT_REPOSITORY
andCMFT_APIKEY
. - The tests can be executed by running the following command from the root directory:
./vendor/bin/phpunit
Pull requests are always welcome!
This repository is published under the MIT license.