Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/BigBlueButton.php
  • Loading branch information
GhaziTriki committed Dec 29, 2021
2 parents 1b377cb + 5ceff70 commit 42e9455
Show file tree
Hide file tree
Showing 22 changed files with 560 additions and 726 deletions.
17 changes: 10 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"authors": [
{
"name": "Ghazi Triki",
"email": "ghazi.[email protected]",
"email": "ghazi.[email protected]",
"role": "Developer"
}
],
Expand All @@ -30,12 +30,15 @@
},
"require-dev": {
"ext-mbstring": "*",
"composer/composer": "^1.10.0",
"phpunit/phpunit": "^8",
"fakerphp/faker": "^1.14",
"friendsofphp/php-cs-fixer": "2.*",
"squizlabs/php_codesniffer": "3.*",
"php-coveralls/php-coveralls": "^2.4.0"
"composer/composer": "^1.10.24",
"phpunit/phpunit": "^8.5",
"fakerphp/faker": "^1.17",
"friendsofphp/php-cs-fixer": "^2.19",
"squizlabs/php_codesniffer": "^3.6",
"php-coveralls/php-coveralls": "^2.5.2"
},
"options": {
"symlink": false
},
"autoload": {
"psr-4": {
Expand Down
61 changes: 14 additions & 47 deletions src/BigBlueButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
use BigBlueButton\Responses\CreateMeetingResponse;
use BigBlueButton\Responses\DeleteRecordingsResponse;
use BigBlueButton\Responses\EndMeetingResponse;
use BigBlueButton\Responses\GetDefaultConfigXMLResponse;
use BigBlueButton\Responses\GetMeetingInfoResponse;
use BigBlueButton\Responses\GetMeetingsResponse;
use BigBlueButton\Responses\GetRecordingsResponse;
Expand All @@ -45,7 +44,6 @@
use BigBlueButton\Responses\IsMeetingRunningResponse;
use BigBlueButton\Responses\JoinMeetingResponse;
use BigBlueButton\Responses\PublishRecordingsResponse;
use BigBlueButton\Responses\SetConfigXMLResponse;
use BigBlueButton\Responses\UpdateRecordingsResponse;
use BigBlueButton\Util\UrlBuilder;
use SimpleXMLElement;
Expand All @@ -60,6 +58,7 @@ class BigBlueButton
protected $bbbServerBaseUrl;
protected $urlBuilder;
protected $jSessionId;
protected $timeOut = 10;

/**
* BigBlueButton constructor.
Expand Down Expand Up @@ -90,8 +89,6 @@ public function getApiVersion()
/* __________________ BBB ADMINISTRATION METHODS _________________ */
/* The methods in the following section support the following categories of the BBB API:
-- create
-- getDefaultConfigXML
-- setConfigXML
-- join
-- end
*/
Expand All @@ -117,47 +114,6 @@ public function createMeeting($createMeetingParams)
return new CreateMeetingResponse($xml);
}

/**
* @return string
*/
public function getDefaultConfigXMLUrl()
{
return $this->urlBuilder->buildUrl(ApiMethod::GET_DEFAULT_CONFIG_XML);
}

/**
* @return GetDefaultConfigXMLResponse
* @throws \RuntimeException
*/
public function getDefaultConfigXML()
{
$xml = $this->processXmlResponse($this->getDefaultConfigXMLUrl());

return new GetDefaultConfigXMLResponse($xml);
}

/**
* @return string
*/
public function setConfigXMLUrl()
{
return $this->urlBuilder->buildUrl(ApiMethod::SET_CONFIG_XML, '', false);
}

/**
* @param $setConfigXMLParams
* @return SetConfigXMLResponse
* @throws \RuntimeException
*/
public function setConfigXML($setConfigXMLParams)
{
$setConfigXMLPayload = $this->urlBuilder->buildQs(ApiMethod::SET_CONFIG_XML, $setConfigXMLParams->getHTTPQuery());

$xml = $this->processXmlResponse($this->setConfigXMLUrl(), $setConfigXMLPayload, 'application/x-www-form-urlencoded');

return new SetConfigXMLResponse($xml);
}

/**
* @param $joinMeetingParams JoinMeetingParameters
*
Expand Down Expand Up @@ -504,7 +460,19 @@ private function processXmlResponse($url, $payload = '', $contentType = 'applica
throw new \RuntimeException('Post XML data set but curl PHP module is not installed or not enabled.');
}
}


/**
* Set Curl Timeout (Optional), Default 10 Seconds
* @param int $TimeOutInSeconds
* @return static
*/
public function setTimeOut($TimeOutInSeconds)
{
$this->timeOut = $TimeOutInSeconds;

return $this;
}

/**
* Public accessor for buildUrl
* @param string $method
Expand All @@ -516,5 +484,4 @@ public function buildUrl($method = '', $params = '', $append = TRUE)
{
return $this->urlBuilder->buildUrl($method, $params, $append);
}

}
3 changes: 0 additions & 3 deletions src/Core/ApiMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ abstract class ApiMethod
const IS_MEETING_RUNNING = 'isMeetingRunning';
const GET_MEETING_INFO = 'getMeetingInfo';
const GET_MEETINGS = 'getMeetings';
const GET_DEFAULT_CONFIG_XML = 'getDefaultConfigXML';
const SET_CONFIG_XML = 'setConfigXML';
const CONFIG_XML = 'configXML';
const SIGN_OUT = 'signOut';
const GET_RECORDINGS = 'getRecordings';
const PUBLISH_RECORDINGS = 'publishRecordings';
Expand Down
54 changes: 23 additions & 31 deletions src/Responses/SetConfigXMLResponse.php → src/Core/GuestPolicy.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
<?php
/**
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
*
* Copyright (c) 2016-2018 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/
namespace BigBlueButton\Responses;
<?php
/**
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
*
* Copyright (c) 2016-2021 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/
namespace BigBlueButton\Core;

/**
* Class SetConfigXMLResponse
* @package BigBlueButton\Parameters
*/
class SetConfigXMLResponse extends BaseResponse
class GuestPolicy
{
/**
* @return bool
*/
public function getToken()
{
return $this->rawXml->configToken->__toString();
}
public const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
public const ALWAYS_DENY = 'ALWAYS_DENY';
public const ASK_MODERATOR = 'ASK_MODERATOR';
}
Original file line number Diff line number Diff line change
@@ -1,49 +1,27 @@
<?php
/**
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
*
* Copyright (c) 2016-2018 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/
namespace BigBlueButton\Responses;
<?php
/**
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
*
* Copyright (c) 2016-2021 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/
namespace BigBlueButton\Core;

/**
* Class GetDefaultConfigXMLUrlResponse
* @package BigBlueButton\Responses
*/
class GetDefaultConfigXMLResponse
class MeetingLayout
{
/**
* @var \SimpleXMLElement
*/
protected $rawXml;

/**
* BaseResponse constructor.
*
* @param \SimpleXMLElement $xml
*/
public function __construct(\SimpleXMLElement $xml)
{
$this->rawXml = $xml;
}

/**
* @return \SimpleXMLElement
*/
public function getRawXml()
{
return $this->rawXml;
}
public const CUSTOM_LAYOUT = 'CUSTOM_LAYOUT';
public const SMART_LAYOUT = 'SMART_LAYOUT';
public const PRESENTATION_FOCUS = 'PRESENTATION_FOCUS';
public const VIDEO_FOCUS = 'VIDEO_FOCUS';
}
Loading

0 comments on commit 42e9455

Please sign in to comment.