Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Auditor committed Mar 2, 2016
0 parents commit b615b01
Show file tree
Hide file tree
Showing 12 changed files with 2,032 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- hhvm

before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev

script: phpunit
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# PHP BigBlueButton API Library

> BigBlueButton is an open source web conferencing system for on-line learning. – http://www.bigbluebutton.org
This is a php library to interface with a BigBlueButton server instance.

## Installation

Get [Composer](https://getcomposer.org/) and install it.
Then clone the repository and run:

composer install

## Usage

To get your API URL and secret login to your BigBlueButton server and run:

$ bbb-conf --secret
URL: http://example.org/bigbluebutton/
Secret: aiShaiteih6nahchie1quaiyul8ce4Zu

Initialize a BigBlueButton object:

<?php

require_once 'vendor/autoload.php';

use sanduhrs\BigBlueButton;

$bbb = new BigBlueButton(
'http://example.org/bigbluebutton/',
'aiShaiteih6nahchie1quaiyul8ce4Zu',
'api/'
);

Get the version of the remote server:

$version = $bbb->server->getVersion();
print "$version\n";

Add a meeting:

$meeting = $bbb->server->addMeeting(
'123-456-789-000',
'Guphei4i',
'ioy9Xep9',
[
'name' => 'A BigBlueButton meeting',
'welcome' => 'Welcome to %%CONFNAME%%.',
'logoutURL' => 'https://example.org/',
'record' = true,
'autoStartRecording' = true,
]
);

Get meeting join URL for a moderator:

$full_name = 'Martin Moderator';
$url = $meeting->join($full_name, true);

Get meeting join URL for an attendee:

$full_name = 'Anton Attendee';
$url = $meeting->join($full_name);

## Tests

./vendor/bin/phpunit

## License
GNU GENERAL PUBLIC LICENSE (GPL)
22 changes: 22 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "sanduhrs/php-bigbluebutton",
"type": "library",
"license": "GPL",
"authors": [
{
"name": "Stefan Auditor",
"email": "stefan.auditor@erdfisch.de"
}
],
"require": {
"guzzlehttp/guzzle": "^6.1"
},
"require-dev": {
"phpunit/phpunit": "^5.2"
},
"autoload": {
"psr-4": {
"sanduhrs\\": "src/"
}
}
}
67 changes: 67 additions & 0 deletions src/BigBlueButton.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

/**
* @file
* Contains sanduhrs\BigBlueButton.
*/

namespace sanduhrs;

use sanduhrs\BigBlueButton\Server;
use sanduhrs\BigBlueButton\Client;

/**
* Class BigBlueButton
*
* @package sanduhrs
*/
class BigBlueButton
{

/**
* The BigBlueButton library version.
*
* @var string
* A version string.
*/
const VERSION = '0.3.0';

/**
* The BigBlueButton API version.
*
* @var string
* A version string.
*/
const API_VERSION = '0.9';

/**
* The BigBlueButton server object.
*
* @var \sanduhrs\BigBlueButton\Server
*/
public $server;

/**
* The BigBlueButton client object.
*
* @var \sanduhrs\BigBlueButton\Client
*/
public $client;


/**
* BigBlueButton constructor.
*
* @param string $url
* @param string $secret
* @param string $endpoint
*/
public function __construct(
$url,
$secret,
$endpoint
) {
$this->client = new Client($url, $secret, $endpoint);
$this->server = new Server($this->client);
}
}
64 changes: 64 additions & 0 deletions src/BigBlueButton/Attendee.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

/**
* @file
* Contains sanduhrs\BigBlueButton\Attendee.
*/

namespace sanduhrs\BigBlueButton;

/**
* Class Attendee
*
* @package sanduhrs\BigBlueButton
*/
class Attendee
{
/**
* The user ID.
*
* @var string
*/
public $userID;

/**
* The full user name.
*
* @var string
*/
public $fullName;

/**
* The user role.
*
* @var string
*/
public $role;

/**
* Custom user data.
*
* @var array
*/
public $customdata;

/**
* Attendee constructor.
*
* @param string $userID
* @param string $fullName
* @param string $role
* @param array $customdata
*/
public function __construct(
$userID,
$fullName,
$role,
$customdata = []
) {
$this->userID = $userID;
$this->fullName = $fullName;
$this->role = $role;
$this->customdata = $customdata;
}
}
9 changes: 9 additions & 0 deletions src/BigBlueButton/BigBlueButtonException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace sanduhrs\BigBlueButton;

use Exception;

class BigBlueButtonException extends Exception
{
}
Loading

0 comments on commit b615b01

Please sign in to comment.