Skip to content

CometBackup/comet-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP SDK for the Comet Server API

@CometBackup on Twitter MIT License Packagist

The Comet Server API allows you to create and manage customer accounts on your Comet Server.

Comet Licensing Ltd makes this library freely available under the MIT license; you may embed it in any PHP project, either free or commercial, as long as the copyright header comment remains intact in the *.php files.

Features

  • Full coverage of Comet Server API methods, data structures, and constant definitions
  • Easy synchronous API requests via the \Comet\Server class
  • PSR-7 support for asynchronous / Promise requests
  • PHP 7.x type hints. For PHP 5.x compatibility, please use the last v3.x SDK release.

Version compatibility

This library uses Semantic Versioning. However, large parts of this library are autogenerated from internal protocol descriptions from a specific version of Comet Server; to find the source Comet Server version, check the \Comet\Def::APPLICATION_VERSION constant.

Newer API libraries can be safely used with older versions of Comet Server, however some features may be unavailable, and any new API properties will be unrecognised and ignored by the Comet Server.

Older API libraries can be safely used with newer versions of Comet Server. Unknown API properties corresponding to new Comet Server features will be preserved via the __unknown_properties system.

Getting Started

Install via Composer:

composer require cometbackup/comet-php-sdk

List all user accounts:

<?php

require 'vendor/autoload.php'; // Load Composer classes

$server = new \Comet\Server("http://127.0.0.1:8060/", "admin", "admin");

$accounts = $server->AdminListUsers();

var_dump($accounts);

Running package tests

This package uses PHPUnit for testing.

  1. Copy the phpunit.xml.dist file to phpunit.xml and modify the COMET_SERVER variables to point at your test Comet Server
  2. Run phpunit

Lint all PHP files:

find ./Comet/ -name '*.php' -exec php -l {} \;

Getting Help

Bug reports and pull requests are welcome on GitHub at https://github.com/CometBackup/comet-php-sdk.

You may also submit issues via the ticket system at cometbackup.com.