ORTC-PHP
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Quality Score][ico-code-quality]
, (*1)
A modern PHP client for ORTC (Open Real-Time Connectivity, realtime & cloud-based pub/sub framework from realtime.co for PHP 5.5+)., (*2)
Install
Via Composer, (*3)
``` bash
$ composer require ninjacto/ortc-php, (*4)
## Usage
``` php
$ortcConfig = new OrtcConfig();
$ortcConfig->setApplicationKey('YOUR_APPLICATION_KEY');
$ortcConfig->setPrivateKey('YOUR_PRIVATE_KEY');
$ortcConfig->setVerifySsl(false);
$url = 'http://ortc-developers.realtime.co/server/2.1'; // ORTC server URL
$authToken = 'YOUR_AUTHENTICATION_TOKEN';
$channels = [];
$testChannel = new Channel();
$testChannel->setName('CHANNEL_NAME');
$testChannel->setPermission(Channel::PERMISSION_READ);
$channels[] = $testChannel;
$ortc = new Ortc($ortcConfig);
$authRequest = new AuthRequest();
$authRequest->setAuthToken($authToken);
$authRequest->setExpireTime(61);
$authRequest->setPrivate(true);
$authRequest->setChannels($channels);
$authResponse = $ortc->authenticate($authRequest);
Change log
Please see CHANGELOG for more information what has changed recently., (*5)
Testing
bash
$ composer test
, (*6)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*7)
Security
If you discover any security related issues, please email ramin.farmani@gmail.com instead of using the issue tracker., (*8)
Credits
License
The MIT License (MIT). Please see License File for more information., (*9)