Skip to content

cmftable/php-sdk

Repository files navigation




PHP Development Kit

Build Status

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

  1. Composer is a prerequisite for running the tests. Install composer globally, then run composer install to install required files.
  2. Create phpunit.xml from phpunit.xml.dist and edit it to add your credentials. Alternatively you can set your credentials as environment variables. For this you have to define CMFT_REPOSITORY and CMFT_APIKEY.
  3. 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!

PRs Welcome

License

This repository is published under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages