comfortable / php-sdk
PHP SDK for comfortable.io
3.3.0
2024-04-11 13:05 UTC
Requires
- php: ^8.3
- ext-curl: *
- ext-json: *
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is not auto-updated.
Last update: 2025-07-03 19:51:37 UTC
README
PHP Development Kit
Installation
The Comfortable PHP SDK can be installed with Composer. Run this command:
composer require comfortable/php-sdk
Usage
Note: This version of the SDK requires PHP 5.6 or greater.
Include the dependency:
<?php require_once __DIR__ . '/vendor/autoload.php'; // change path as needed use Comfortable;
Connect to your Repository and make your first request:
$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.
Tests
- 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
More information
Contributing
Pull requests are always welcome!
License
This repository is published under the MIT license.