PHPackages                             siliconstraits/cems-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. siliconstraits/cems-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

siliconstraits/cems-php-sdk
===========================

PHP SDK for SSS CEMS platform

1.0.2(11y ago)018MITPHPPHP &gt;=5.3.2

Since Jul 9Pushed 11y ago32 watchersCompare

[ Source](https://github.com/siliconstraits/cems-php-sdk)[ Packagist](https://packagist.org/packages/siliconstraits/cems-php-sdk)[ Docs](https://github.com/siliconstraits/cems-php-sdk)[ RSS](/packages/siliconstraits-cems-php-sdk/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (2)Versions (12)Used By (0)

cems-php-sdk
============

[](#cems-php-sdk)

This is the official PHP-SDK for CEMS's API. [View api documentation and examples.](https://docs.cemsadmin.apiary.io)

\##Build Status [![Build Status](https://camo.githubusercontent.com/5168f584ce7bba48eadf70c7616afd84c521740a437adfd99964f4246bd7bc70/68747470733a2f2f7472617669732d63692e6f72672f73696c69636f6e737472616974732f63656d732d7068702d73646b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/siliconstraits/cems-php-sdk)

\##Installation

### Requirements

[](#requirements)

1. PHP &gt;= 5.3.2
2. PHP curl extensions.

You don't need to clone the repo directly to use this SDK, the entire library and its dependencies can be installed through Composer (  ).

- First, install Composer if you haven't had it already

```
curl -sS https://getcomposer.org/installer | php
```

- Create `composer.json` and add the following

```
{
   "require": {
       "siliconstraits/cems-php-sdk": "dev-master"
   }
}
```

- Install `cems-php-sdk` package via Composer

```
php composer.phar install
```

- Include the library in your script

```
require_once 'vendor/autoload.php';
```

- See below for how to configure your Client class.

\##Configuration

All CEMS API requests can be made using the `CEMS\Client` class. This class must be initialized with your authentication details such as an API key (preferred), email/password combo. Remember to declare the API URL from CEMS service for proper connection to your own server.

### API key Config

[](#api-key-config)

```
$client = new CEMS\Client($access_token, $apiUrl);
```

### Email/Password Config

[](#emailpassword-config)

```
$client = new CEMS\Client($email, $password, $apiUrl);
```

Your app users are almost ready to start signing! See below for the most common use cases for this wrapper.

\##Usage
--------

[](#usage)

### Create a RESTful Request

[](#create-a-restful-request)

You can create a RESTful request by using one of following method from an instance of Client class:

```
$client->post($path, $params=array());
$client->get($path, $params=array());
$client->get($path, $params=array());
$client->get($path, $params=array());
```

For example:

```
try {
  $response= $client->get(
    'events',
    array(
        'category_id' => array(1, 2)
    )
  ); // CEMS\Response
}
catch (CEMS\Error $e) {
    echo $e;
}
```

*NOTE*: You must provide the right path from API documentation. *NOTE2*: For the compatibility problem of Guzzle between PHP 5.3 and 5.4, and Composer still not support multiple package version with correspond PHP environment, we assure you that the local test has been passed before release each iterative version.

The request will automatically return a Response object contain JSON data return from API if success. Then you can retrieve the proper result by using the method `getObject($type='CEMS\Resource')` or `getObjectList($type='CEMS\Resource')`

```
$customer = $client->get('customers/$id')->getObject(); // CEMS\Resource
$customers = $client->get('customers')->getObjectList('customer'); // CEMS\Collection Class contains many CEMS\Customer elements
```

### Retrieving fields returned from the API

[](#retrieving-fields-returned-from-the-api)

Using magic methods to set or get fields

```
$customer->name = 'Nguyen Le Xuan';
echo $customer->name;
```

Or if you want to get all attributes in an array

```
foreach ($customers as $customer) {
  print_r($customer->toArray());
  // toObject()
}
```

\##Testing
----------

[](#testing)

This project contains PHPUnit tests that check the SDK code and can also be referenced for examples. Most are functional and integrated tests that walk through real user scenarios. In some cases, this means you must have an active network connection with access to CEMS system to execute all tests.

### To run the tests

[](#to-run-the-tests)

- Copy file `phpunit.xml.sample` to `phpunit.xml`
- Edit the new file, uncomment and enter your `API_KEY`, `CLIENT_ID`, `CLIENT_SECRET` and `CALLBACK_URL`
- Make sure your account has at least 1 template
- Run `./vendor/bin/phpunit`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

11

Last Release

4322d ago

Major Versions

0.9.8 → 1.02014-07-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5810501?v=4)[Hai Phan Nguyen](/maintainers/pnghai)[@pnghai](https://github.com/pnghai)

---

Top Contributors

[![pnghai](https://avatars.githubusercontent.com/u/5810501?v=4)](https://github.com/pnghai "pnghai (87 commits)")

---

Tags

sdkcems

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/siliconstraits-cems-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/siliconstraits-cems-php-sdk/health.svg)](https://phpackages.com/packages/siliconstraits-cems-php-sdk)
```

###  Alternatives

[aws/aws-crt-php

AWS Common Runtime for PHP

416300.1M4](/packages/aws-aws-crt-php)[zumba/amplitude-php

PHP SDK for Amplitude

409.5M5](/packages/zumba-amplitude-php)[ennnnny/tbk

简约优雅的淘宝客SDK

29016.1k1](/packages/ennnnny-tbk)[anilcancakir/laravel-ai-sdk-skills

A skill system for Laravel AI SDK agents. Define reusable AI capabilities with SKILL.md files.

151.1k](/packages/anilcancakir-laravel-ai-sdk-skills)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
