├── .github └── workflows │ ├── config.json │ ├── config_all.json │ ├── moodle-ci.yml │ └── moodle-release.yml ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── amd ├── build │ ├── maintenance.min.js │ ├── maintenance.min.js.map │ ├── tabulator.min.js │ ├── tabulator.min.js.map │ ├── tool_settings.min.js │ ├── tool_settings.min.js.map │ ├── tool_testtool.min.js │ └── tool_testtool.min.js.map └── src │ ├── maintenance.js │ ├── tabulator.js │ ├── tool_settings.js │ └── tool_testtool.js ├── classes ├── api │ ├── handler │ │ └── api_handler_stack.php │ └── middleware │ │ └── api_middlewares.php ├── empty_configuration_exception.php ├── exception │ ├── opencast_api_http_errors_exception.php │ └── opencast_api_response_exception.php ├── local │ ├── PolyfillCURLStringFile.php │ ├── api.php │ ├── api_testable.php │ ├── environment_util.php │ ├── maintenance_class.php │ ├── opencast_instance.php │ └── settings_api.php ├── privacy │ └── provider.php ├── proxy │ ├── decorated_opencastapi_rest_client.php │ └── decorated_opencastapi_service.php ├── seriesmapping.php └── settings │ ├── admin_setting_configdatetimeselector.php │ ├── admin_setting_configeditabletable.php │ ├── admin_setting_configtextwithvalidation.php │ └── admin_settings_builder.php ├── composer.json ├── composer.lock ├── css ├── styles.css ├── tabulator.min.css └── tabulator_bootstrap4.min.css ├── db ├── access.php ├── install.php ├── install.xml ├── services.php └── upgrade.php ├── external.php ├── lang └── en │ └── tool_opencast.php ├── settings.php ├── tests ├── behat │ ├── behat_tool_opencast.php │ ├── tool_opencast.feature │ ├── tool_opencast_connectiontool.feature │ └── tool_opencast_maintenace.feature └── generator │ ├── behat_tool_opencast_generator.php │ └── lib.php ├── thirdpartylibs.xml ├── vendor ├── autoload.php ├── composer │ ├── ClassLoader.php │ ├── InstalledVersions.php │ ├── LICENSE │ ├── autoload_classmap.php │ ├── autoload_files.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_real.php │ ├── autoload_static.php │ ├── installed.json │ └── installed.php ├── elan-ev │ └── opencast-api │ │ ├── .github │ │ └── workflows │ │ │ └── opencast-php-lib-ci.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── UPGRADING.md │ │ ├── composer.json │ │ ├── composer.lock │ │ ├── phpunit.xml │ │ ├── src │ │ └── OpencastApi │ │ │ ├── Mock │ │ │ └── OcMockHanlder.php │ │ │ ├── Opencast.php │ │ │ ├── Rest │ │ │ ├── OcAgentsApi.php │ │ │ ├── OcBaseApi.php │ │ │ ├── OcCaptureAdmin.php │ │ │ ├── OcEventAdminNg.php │ │ │ ├── OcEventsApi.php │ │ │ ├── OcGroupsApi.php │ │ │ ├── OcIngest.php │ │ │ ├── OcListProvidersApi.php │ │ │ ├── OcPlaylistsApi.php │ │ │ ├── OcRecordings.php │ │ │ ├── OcRest.php │ │ │ ├── OcRestClient.php │ │ │ ├── OcSearch.php │ │ │ ├── OcSecurityApi.php │ │ │ ├── OcSeries.php │ │ │ ├── OcSeriesApi.php │ │ │ ├── OcServices.php │ │ │ ├── OcStatisticsApi.php │ │ │ ├── OcSysinfo.php │ │ │ ├── OcWorkflow.php │ │ │ └── OcWorkflowsApi.php │ │ │ └── Util │ │ │ └── OcUtils.php │ │ └── tests │ │ ├── DataProvider │ │ ├── EventsDataProvider.php │ │ ├── GroupsDataProvider.php │ │ ├── IngestDataProvider.php │ │ ├── PlaylistsDataProvider.php │ │ ├── SearchDataProvider.php │ │ ├── SeriesDataProvider.php │ │ ├── SetupDataProvider.php │ │ ├── StatisticsDataProvider.php │ │ ├── WorkflowDataProvider.php │ │ ├── WorkflowsApiDataProvider.php │ │ ├── mock_responses │ │ │ ├── api_agents.json │ │ │ ├── api_base.json │ │ │ ├── api_events.json │ │ │ ├── api_groups.json │ │ │ ├── api_playlists.json │ │ │ ├── api_security.json │ │ │ ├── api_series.json │ │ │ ├── api_statistics.json │ │ │ ├── api_workflows.json │ │ │ ├── ingests.json │ │ │ ├── search.json │ │ │ ├── services.json │ │ │ └── sysinfo.json │ │ └── test_files │ │ │ ├── audio_test.mp3 │ │ │ ├── dublincore-episode.xml │ │ │ ├── ingest.xml │ │ │ ├── video_test.mp4 │ │ │ ├── video_test_de.vtt │ │ │ ├── video_test_en.vtt │ │ │ ├── video_test_overwrite_de.vtt │ │ │ └── xacml-episode.xml │ │ ├── Results │ │ ├── progress.txt │ │ └── progress_ingest.txt │ │ ├── Unit │ │ ├── OcAgentsApiTest.php │ │ ├── OcBaseApiTest.php │ │ ├── OcEventsApiTest.php │ │ ├── OcGroupsApiTest.php │ │ ├── OcIngestTest.php │ │ ├── OcListProvidersApiTest.php │ │ ├── OcPlaylistsApiTest.php │ │ ├── OcRestClientWithGuzzleOptionTest.php │ │ ├── OcSearchTest.php │ │ ├── OcSecurityApiTest.php │ │ ├── OcSeriesApiTest.php │ │ ├── OcServicesTest.php │ │ ├── OcStatisticsApiTest.php │ │ ├── OcSysinfoTest.php │ │ ├── OcWorkflowTest.php │ │ └── OcWorkflowsApiTest.php │ │ └── UnitMock │ │ ├── OcAgentsApiTestMock.php │ │ ├── OcBaseApiTestMock.php │ │ ├── OcEventsApiTestMock.php │ │ ├── OcGroupsApiTestMock.php │ │ ├── OcIngestTestMock.php │ │ ├── OcPlaylistsApiTestMock.php │ │ ├── OcSearchTestMock.php │ │ ├── OcSecurityApiTestMock.php │ │ ├── OcSeriesApiTestMock.php │ │ ├── OcServicesTestMock.php │ │ ├── OcStatisticsApiTestMock.php │ │ ├── OcSysinfoTestMock.php │ │ └── OcWorkflowsApiTestMock.php ├── guzzlehttp │ ├── guzzle │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── UPGRADING.md │ │ ├── composer.json │ │ └── src │ │ │ ├── BodySummarizer.php │ │ │ ├── BodySummarizerInterface.php │ │ │ ├── Client.php │ │ │ ├── ClientInterface.php │ │ │ ├── ClientTrait.php │ │ │ ├── Cookie │ │ │ ├── CookieJar.php │ │ │ ├── CookieJarInterface.php │ │ │ ├── FileCookieJar.php │ │ │ ├── SessionCookieJar.php │ │ │ └── SetCookie.php │ │ │ ├── Exception │ │ │ ├── BadResponseException.php │ │ │ ├── ClientException.php │ │ │ ├── ConnectException.php │ │ │ ├── GuzzleException.php │ │ │ ├── InvalidArgumentException.php │ │ │ ├── RequestException.php │ │ │ ├── ServerException.php │ │ │ ├── TooManyRedirectsException.php │ │ │ └── TransferException.php │ │ │ ├── Handler │ │ │ ├── CurlFactory.php │ │ │ ├── CurlFactoryInterface.php │ │ │ ├── CurlHandler.php │ │ │ ├── CurlMultiHandler.php │ │ │ ├── EasyHandle.php │ │ │ ├── HeaderProcessor.php │ │ │ ├── MockHandler.php │ │ │ ├── Proxy.php │ │ │ └── StreamHandler.php │ │ │ ├── HandlerStack.php │ │ │ ├── MessageFormatter.php │ │ │ ├── MessageFormatterInterface.php │ │ │ ├── Middleware.php │ │ │ ├── Pool.php │ │ │ ├── PrepareBodyMiddleware.php │ │ │ ├── RedirectMiddleware.php │ │ │ ├── RequestOptions.php │ │ │ ├── RetryMiddleware.php │ │ │ ├── TransferStats.php │ │ │ ├── Utils.php │ │ │ ├── functions.php │ │ │ └── functions_include.php │ ├── promises │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ │ ├── AggregateException.php │ │ │ ├── CancellationException.php │ │ │ ├── Coroutine.php │ │ │ ├── Create.php │ │ │ ├── Each.php │ │ │ ├── EachPromise.php │ │ │ ├── FulfilledPromise.php │ │ │ ├── Is.php │ │ │ ├── Promise.php │ │ │ ├── PromiseInterface.php │ │ │ ├── PromisorInterface.php │ │ │ ├── RejectedPromise.php │ │ │ ├── RejectionException.php │ │ │ ├── TaskQueue.php │ │ │ ├── TaskQueueInterface.php │ │ │ ├── Utils.php │ │ │ ├── functions.php │ │ │ └── functions_include.php │ └── psr7 │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ ├── AppendStream.php │ │ ├── BufferStream.php │ │ ├── CachingStream.php │ │ ├── DroppingStream.php │ │ ├── Exception │ │ └── MalformedUriException.php │ │ ├── FnStream.php │ │ ├── Header.php │ │ ├── HttpFactory.php │ │ ├── InflateStream.php │ │ ├── LazyOpenStream.php │ │ ├── LimitStream.php │ │ ├── Message.php │ │ ├── MessageTrait.php │ │ ├── MimeType.php │ │ ├── MultipartStream.php │ │ ├── NoSeekStream.php │ │ ├── PumpStream.php │ │ ├── Query.php │ │ ├── Request.php │ │ ├── Response.php │ │ ├── Rfc7230.php │ │ ├── ServerRequest.php │ │ ├── Stream.php │ │ ├── StreamDecoratorTrait.php │ │ ├── StreamWrapper.php │ │ ├── UploadedFile.php │ │ ├── Uri.php │ │ ├── UriComparator.php │ │ ├── UriNormalizer.php │ │ ├── UriResolver.php │ │ └── Utils.php ├── psr │ ├── http-client │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ │ ├── ClientExceptionInterface.php │ │ │ ├── ClientInterface.php │ │ │ ├── NetworkExceptionInterface.php │ │ │ └── RequestExceptionInterface.php │ ├── http-factory │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ │ ├── RequestFactoryInterface.php │ │ │ ├── ResponseFactoryInterface.php │ │ │ ├── ServerRequestFactoryInterface.php │ │ │ ├── StreamFactoryInterface.php │ │ │ ├── UploadedFileFactoryInterface.php │ │ │ └── UriFactoryInterface.php │ └── http-message │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ ├── docs │ │ ├── PSR7-Interfaces.md │ │ └── PSR7-Usage.md │ │ └── src │ │ ├── MessageInterface.php │ │ ├── RequestInterface.php │ │ ├── ResponseInterface.php │ │ ├── ServerRequestInterface.php │ │ ├── StreamInterface.php │ │ ├── UploadedFileInterface.php │ │ └── UriInterface.php ├── ralouphie │ └── getallheaders │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ └── getallheaders.php └── symfony │ └── deprecation-contracts │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── function.php └── version.php /.github/workflows/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "main-moodle": "MOODLE_405_STABLE", 3 | "main-php": "8.3", 4 | "main-oc": "16.6", 5 | "ocs": ["16.6", "15.11"], 6 | "main-db": "mariadb", 7 | "moodle-php": { 8 | "MOODLE_405_STABLE": ["8.1", "8.2"] 9 | }, 10 | "moodle-plugin-ci": "4.4.5" 11 | } 12 | -------------------------------------------------------------------------------- /.github/workflows/config_all.json: -------------------------------------------------------------------------------- 1 | { 2 | "main-moodle": "MOODLE_405_STABLE", 3 | "main-php": "8.3", 4 | "main-oc": "16.6", 5 | "ocs": ["16.6", "15.11"], 6 | "main-db": "mariadb", 7 | "moodle-php": { 8 | "MOODLE_401_STABLE": ["7.4", "8.0", "8.1"], 9 | "MOODLE_402_STABLE": ["8.0", "8.1", "8.2"], 10 | "MOODLE_403_STABLE": ["8.0", "8.1", "8.2"], 11 | "MOODLE_404_STABLE": ["8.1", "8.2", "8.3"], 12 | "MOODLE_405_STABLE": ["8.1", "8.2", "8.3"] 13 | }, 14 | "moodle-plugin-ci": "4.4.5" 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/moodle-ci.yml: -------------------------------------------------------------------------------- 1 | name: Moodle Plugin CI 2 | 3 | ######################################################################################################################## 4 | 5 | on: [ push, pull_request ] 6 | 7 | ######################################################################################################################## 8 | 9 | jobs: 10 | call-moodle-ci-workflow: 11 | uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-ci.yml@main 12 | with: 13 | requires-block-plugin: true 14 | branch-block-plugin: main 15 | -------------------------------------------------------------------------------- /.github/workflows/moodle-release.yml: -------------------------------------------------------------------------------- 1 | name: Moodle Plugin Release 2 | 3 | ######################################################################################################################## 4 | 5 | on: 6 | release: 7 | types: [published] 8 | 9 | ######################################################################################################################## 10 | 11 | jobs: 12 | call-moodle-release-workflow: 13 | uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-release.yml@main 14 | with: 15 | plugin-name: 'tool_opencast' 16 | secrets: inherit 17 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | 4.5.3 (2025-01-16) 5 | ------------------ 6 | * [FIX] #74 Refactor settings handling when propagating 7 | * [FIX] #73 Delete settings of all plugins when deleting an instance 8 | * [FEATURE] #72 Add support for Opencast maintenance periods 9 | * [FEATURE] #70 Improved Opencast API exceptions and error handling 10 | 11 | 12 | 4.5.2 aka 4.5.1 (2024-12-03) 13 | ------------------ 14 | * [FIX] #69 Lang file (en) sorted alphabetically 15 | * [FEATURE] #63 Upgrade Opencast PHP Library to 1.8.0/Api Version setting (OC 16 Support)/Moodle 4.4 Required Changes 16 | 17 | 18 | 4.5.0 (2024-11-12) 19 | ------------------ 20 | Moodle 4.5 compatible version 21 | 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # moodle-tool_opencast - Opencast API # 2 | 3 | This tool provides API functions as well as general settings for the different opencast tools. 4 | 5 | This file is part of the mod_opencast plugin for Moodle - 6 | 7 | *Maintainer:* Thomas Niedermaier (Universität Münster), Farbod Zamani (Elan e.V.) 8 | 9 | *Copyright:* 2024 Thomas Niedermaier, UNIVERSITÄT MÜNSTER 10 | 11 | *License:* [GNU GPL v3 or later](http://www.gnu.org/copyleft/gpl.html) 12 | 13 | 14 | Description 15 | ----------- 16 | 17 | This tool provides API functions as well as general settings for the different opencast tools: 18 | * [block_opencast](https://github.com/unirz-tu-ilmenau/moodle-block_opencast) 19 | * [mod_opencast](https://github.com/unirz-tu-ilmenau/moodle-mod_opencast) 20 | * [filter_opencast](https://github.com/unirz-tu-ilmenau/moodle-filter_opencast) 21 | * [repository_opencast](https://github.com/unirz-tu-ilmenau/moodle-repository_opencast) 22 | 23 | The tool stores the relation between courses and series ids and 24 | offers webservice endpoints for the opencast role provider. 25 | 26 | 27 | Installation 28 | ------------ 29 | 30 | * Copy the module code directly to the admin/tool/opencast directory. 31 | 32 | * Log into Moodle as administrator. 33 | 34 | * Open the administration area (http://your-moodle-site/admin) to start the installation 35 | automatically. 36 | 37 | 38 | Admin Settings 39 | -------------- 40 | 41 | View the documentation of the plugin settings [here](https://moodle.docs.opencast.org/#tool/settings/). 42 | 43 | 44 | ## Documentation ## 45 | 46 | The full documentation of the plugin can be found [here](https://moodle.docs.opencast.org/#tool/about/). 47 | 48 | 49 | Bug Reports / Support 50 | --------------------- 51 | 52 | We try our best to deliver bug-free plugins, but we can not test the plugin for every platform, 53 | database, PHP and Moodle version. If you find any bug please report it on 54 | [GitHub](https://github.com/Opencast-Moodle/moodle-tool_opencast/issues). Please 55 | provide a detailed bug description, including the plugin and Moodle version and, if applicable, a 56 | screenshot. 57 | 58 | You may also file a request for enhancement on GitHub. 59 | 60 | 61 | ## License ## 62 | 63 | This plugin is developed in cooperation with the TU Ilmenau and the WWU Münster. 64 | 65 | It is based on 2017 Andreas Wagner, SYNERGY LEARNING 66 | 67 | This program is free software: you can redistribute it and/or modify it under 68 | the terms of the GNU General Public License as published by the Free Software 69 | Foundation, either version 3 of the License, or (at your option) any later 70 | version. 71 | 72 | This program is distributed in the hope that it will be useful, but WITHOUT ANY 73 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 74 | PARTICULAR PURPOSE. See the GNU General Public License for more details. 75 | 76 | You should have received a copy of the GNU General Public License along with 77 | this program. If not, see . 78 | -------------------------------------------------------------------------------- /amd/build/tool_testtool.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * AMD module for opencast connection test tool 3 | * 4 | * @module tool_opencast/tool_testtool 5 | * @copyright 2021 Farbod Zamani (zamani@elan-ev.de) 6 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 7 | */ 8 | define("tool_opencast/tool_testtool",["jquery","core/ajax","core/str","core/modal_factory","core/notification"],(function($,Ajax,Str,ModalFactory,Notification){var TestTool=function(){this.activateButton(),this.registerClickEvent()};return TestTool.prototype.activateButton=function(){$(".testtool-modal").each((function(){$(this).is(":visible")&&$(this).hasClass("disabled")&&($(this).removeAttr("disabled"),$(this).removeAttr("title"),$(this).removeClass("disabled btn-warning"),$(this).addClass("btn-secondary"))}))},TestTool.prototype.registerClickEvent=function(){$(".testtool-modal").click((function(e){e.preventDefault();var instanceid=$(e.target).data("instanceid"),suffix=instanceid?"_"+instanceid:"",request=[{methodname:"tool_opencast_connection_test_tool",args:{apiurl:$("#admin-apiurl"+suffix).find("input").val(),apiusername:$("#admin-apiusername"+suffix).find("input").val(),apipassword:$("#admin-apipassword"+suffix).find("input").val(),apitimeout:$("#admin-apitimeout"+suffix).find("input").val(),apiconnecttimeout:$("#admin-apiconnecttimeout"+suffix).find("input").val()}}],promise=Ajax.call(request),titlePromise=Str.get_string("testtoolurl","tool_opencast"),modalPromise=ModalFactory.create({type:ModalFactory.types.CANCEL});$.when(promise[0],titlePromise,modalPromise).then((function(connectionTestResponse,title,modal){return modal.setTitle(title),modal.setBody(connectionTestResponse.testresult),modal.show(),modal})).catch(Notification.exception)}))},{init:function(){return new TestTool}}})); 9 | 10 | //# sourceMappingURL=tool_testtool.min.js.map -------------------------------------------------------------------------------- /classes/empty_configuration_exception.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Exception, which is thrown when the tool settings are emtpy. 19 | * 20 | * @package tool_opencast 21 | * @copyright 2021 Tamara Gunkel, University of Münster 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace tool_opencast; 26 | 27 | /** 28 | * Exception, which is thrown when the tool settings are empty. 29 | * 30 | * @package tool_opencast 31 | * @copyright 2021 Tamara Gunkel, University of Münster 32 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 33 | */ 34 | class empty_configuration_exception extends \moodle_exception { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /classes/exception/opencast_api_http_errors_exception.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Opencast API HTTP Errors Exception. 19 | * This is the exception mostly to be used in middlewares to find and replace the error message. 20 | * 21 | * @package tool_opencast 22 | * @copyright 2024 Farbod Zamani Boroujeni, ELAN e.V. 23 | * @author Farbod Zamani Boroujeni 24 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 25 | */ 26 | 27 | namespace tool_opencast\exception; 28 | 29 | use moodle_exception; 30 | 31 | /** 32 | * Opencast API HTTP Errors Exception. 33 | * This is the exception mostly to be used in middlewares to find and replace the error message. 34 | * 35 | * @package tool_opencast 36 | * @copyright 2024 Farbod Zamani Boroujeni, ELAN e.V. 37 | * @author Farbod Zamani Boroujeni 38 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 39 | */ 40 | class opencast_api_http_errors_exception extends moodle_exception { 41 | /** 42 | * Constructor of class opencast_api_http_errors_exception. 43 | * 44 | * @param string $errorkey the error string key 45 | * @param int $errorcodenum the error code 46 | * @param bool $replacemessage the flag to determine whether to replace the errorkey with message. 47 | */ 48 | public function __construct(string $errorkey, int $errorcodenum, bool $replacemessage = false) { 49 | $this->code = $errorcodenum; 50 | parent::__construct($errorkey, 'tool_opencast'); 51 | if ($replacemessage) { 52 | $this->message = $errorkey; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /classes/exception/opencast_api_response_exception.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Opencast API Response Exception. 19 | * This should be used to throw exception when a response is made, in order to digest the response from Opencast API 20 | * and to decide the best error message. 21 | * 22 | * @package tool_opencast 23 | * @copyright 2024 Farbod Zamani Boroujeni, ELAN e.V. 24 | * @author Farbod Zamani Boroujeni 25 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 26 | */ 27 | 28 | namespace tool_opencast\exception; 29 | 30 | use moodle_exception; 31 | 32 | /** 33 | * Opencast API Response Exception. 34 | * This should be used to throw exception when a response is made, in order to digest the response from Opencast API 35 | * and to decide the best error message. 36 | * 37 | * @package tool_opencast 38 | * @copyright 2024 Farbod Zamani Boroujeni, ELAN e.V. 39 | * @author Farbod Zamani Boroujeni 40 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 41 | */ 42 | class opencast_api_response_exception extends moodle_exception { 43 | /** 44 | * Constructor of class opencast_api_response_exception. 45 | * 46 | * @param array $response the response array that must contain the following: 47 | * - reason: the reason for the exception 48 | * - code: the exception/error code 49 | * @param bool $replacemessage the flag to determine whether to replace the reason with message. 50 | */ 51 | public function __construct(array $response, bool $replacemessage = true) { 52 | $reason = !empty($response['reason']) ? $response['reason'] : null; 53 | $errorkey = !empty($reason) ? $reason : 'exception_request_generic'; 54 | $this->code = isset($response['code']) ? $response['code'] : 500; 55 | parent::__construct($errorkey, 'tool_opencast'); 56 | // In case, the reason has already been set by middleware exception, we should show it as error message. 57 | if (!empty($reason) && $replacemessage) { 58 | $this->message = $reason; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /classes/local/PolyfillCURLStringFile.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Polyfill for CURLStringFile (since PHP 8.0). 19 | * 20 | * @package tool_opencast 21 | * @copyright 2021 Tamara Gunkel 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace tool_opencast\local; 26 | 27 | /** 28 | * Polyfill for CURLStringFile (since PHP 8.0). 29 | * 30 | * @package tool_opencast 31 | * @copyright 2021 Tamara Gunkel 32 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 33 | */ 34 | class PolyfillCURLStringFile extends \CURLFile { 35 | /** @var string File data */ 36 | private $data; 37 | 38 | /** 39 | * Creates the file. 40 | * @param string $data 41 | * @param string $postname 42 | * @param string $mime 43 | */ 44 | public function __construct(string $data, string $postname, string $mime = 'application/octet-stream') { 45 | $this->data = $data; 46 | parent::__construct('data://application/octet-stream;base64,' . base64_encode($data), $mime, $postname); 47 | } 48 | 49 | /** 50 | * Set a new file value. 51 | * @param string $name 52 | * @param string $value 53 | */ 54 | public function __set(string $name, $value): void { 55 | if ('data' === $name) { 56 | $this->name = 'data://application/octet-stream;base64,' . base64_encode($value); 57 | } 58 | 59 | $this->{$name} = $value; 60 | } 61 | 62 | /** 63 | * Check if data is set. 64 | * @param string $name 65 | * @return bool 66 | */ 67 | public function __isset(string $name): bool { 68 | return isset($this->{$name}); 69 | } 70 | 71 | /** 72 | * Returns data. 73 | * @param string $name 74 | * @return mixed 75 | */ 76 | public function __get(string $name) { 77 | return $this->{$name}; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /classes/local/environment_util.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | namespace tool_opencast\local; 18 | 19 | /** 20 | * An environment util for the Opencast Moodle plugins. 21 | * 22 | * @package tool_opencast 23 | * @copyright 2023 Matthias Kollenbroich, University of Münster 24 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 25 | */ 26 | class environment_util { 27 | /** 28 | * Make this class not instantiable. 29 | */ 30 | private function __construct() { 31 | } 32 | 33 | /** 34 | * Returns, whether the current application is a CLI application. 35 | * 36 | * @return bool Returns, true, if the current application is a CLI application, 37 | * and false otherwise. 38 | */ 39 | public static function is_cli_application(): bool { 40 | return http_response_code() === false; 41 | } 42 | 43 | /** 44 | * Returns, whether the current application runs in the environment of a moodle-plugin-ci workflow, 45 | * namely, returns, whether the environment variable is_moodle_plugin_ci_workflow is defined. 46 | * 47 | * @return bool Returns, true, if the current application runs in the environment of a moodle-plugin-ci workflow, 48 | * and false otherwise. 49 | */ 50 | public static function is_moodle_plugin_ci_workflow(): bool { 51 | return !(getenv('is_moodle_plugin_ci_workflow') === false); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /classes/local/opencast_instance.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | namespace tool_opencast\local; 18 | 19 | /** 20 | * A class, to represent Opencast instances for Moodle. 21 | * 22 | * An instance of this class represents an Opencast instance for Moodle and has the properties, 23 | * that are given by or are definable with the admin settings of tool_opencast for an Opencast instance. 24 | * 25 | * @package tool_opencast 26 | * @copyright 2022 Matthias Kollenbroich, University of Münster 27 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 28 | */ 29 | class opencast_instance { 30 | 31 | /** 32 | * The id of the Opencast instance. 33 | * 34 | * This id identifies the configuration of the Opencast instance for Moodle 35 | * and is not explicitly associated to Opencast. 36 | * 37 | * Note, that a valid id of an Opencast instance is greater than zero. 38 | * 39 | * @var int 40 | */ 41 | public $id; 42 | 43 | /** 44 | * The name of the Opencast instance. 45 | * 46 | * @var string 47 | */ 48 | public $name; 49 | 50 | /** 51 | * The visibility state of the Opencast instance. 52 | * 53 | * @var bool 54 | */ 55 | public $isvisible; 56 | 57 | /** 58 | * The default state of the Opencast instance. 59 | * 60 | * Exactly one of the for Moodle configured Opencast instances 61 | * is the default Opencast instance. 62 | * For this instance, this property is true. 63 | * For all other instances, this property is false. 64 | * 65 | * @var bool 66 | */ 67 | public $isdefault; 68 | 69 | /** 70 | * Constructs an instance with the properties of the passed \stdClass instance, 71 | * which are copied. 72 | * 73 | * All properties, that are required for an instance of the class 74 | * opencast_instance, must be defined for the passed \stdClass instance. 75 | * 76 | * @param \stdClass $dynamicobject 77 | */ 78 | public function __construct(\stdClass $dynamicobject) { 79 | $this->id = $dynamicobject->id; 80 | $this->name = $dynamicobject->name; 81 | $this->isvisible = $dynamicobject->isvisible; 82 | $this->isdefault = $dynamicobject->isdefault; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /classes/privacy/provider.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Privacy Subsystem implementation for tool opencast. 19 | * 20 | * @package tool_opencast 21 | * @copyright 2018 Tobias Reischmann 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace tool_opencast\privacy; 26 | 27 | /** 28 | * Privacy Subsystem for tool_opencast implementing null_provider. 29 | * 30 | * @copyright 2018 Tobias Reischmann 31 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 32 | */ 33 | class provider implements \core_privacy\local\metadata\null_provider { 34 | /** 35 | * Get the language string identifier with the component's language 36 | * file to explain why this plugin stores no data. 37 | * 38 | * @return string 39 | */ 40 | public static function get_reason(): string { 41 | return 'privacy:metadata'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /classes/proxy/decorated_opencastapi_rest_client.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | namespace tool_opencast\proxy; 18 | 19 | use OpencastApi\Rest\OcRestClient; 20 | use tool_opencast\local\maintenance_class; 21 | 22 | /** 23 | * A decorated proxy class to wrap around the Opencast API Rest Client class. 24 | * 25 | * This proxy class is meant to have more local control over the overall system app interaction with Opencast API Library. 26 | * Its main purpose is to apply a top layer controller such as maintenance checkers. 27 | * 28 | * @package tool_opencast 29 | * @copyright 2024 Farbod Zamani Boroujeni, ELAN e.V. 30 | * @author Farbod Zamani Boroujeni 31 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 32 | */ 33 | class decorated_opencastapi_rest_client { 34 | 35 | /** @var OcRestClient The Opencast API Rest Client */ 36 | private OcRestClient $restclient; 37 | 38 | /** @var maintenance_class|null The maintenance class */ 39 | private ?maintenance_class $maintenance; 40 | 41 | /** 42 | * Constructor 43 | * @param array $config The Opencast API configuration 44 | * @param maintenance_class|null $maintenance The maintenance class 45 | */ 46 | public function __construct(array $config, ?maintenance_class $maintenance = null) { 47 | $this->restclient = new OcRestClient($config); 48 | $this->maintenance = $maintenance; 49 | } 50 | 51 | /** 52 | * Magic method to handle method calls on the decorated proxy object. 53 | * 54 | * If the maintenance class is set and the current method is not allowed, it will restrict access. 55 | * Otherwise, it will call the actual Opencast API Rest Client method. 56 | * @param string $method The method name to be called 57 | * @param array $args An array of arguments passed to the method 58 | * 59 | * @return mixed|void The result of the method call, or void if it is in maintenance mode. 60 | */ 61 | public function __call(string $method, array $args) { 62 | if (!empty($this->maintenance) && !$this->maintenance->can_access($method)) { 63 | return $this->maintenance->decide_access_bounce(); 64 | } 65 | $returedresult = call_user_func_array([$this->restclient, $method], $args); 66 | if ($returedresult === $this->restclient) { 67 | return $this; 68 | } 69 | return $returedresult; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /classes/seriesmapping.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Persistable of seriesmapping 19 | * 20 | * @package tool_opencast 21 | * @copyright 2018 Tobias Reischmann WWU 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace tool_opencast; 26 | 27 | use tool_opencast\local\settings_api; 28 | 29 | /** 30 | * Persistable of seriesmapping 31 | * 32 | * @package tool_opencast 33 | * @copyright 2018 Tobias Reischmann WWU 34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 35 | */ 36 | class seriesmapping extends \core\persistent { 37 | 38 | /** Table name for the persistent. */ 39 | const TABLE = 'tool_opencast_series'; 40 | 41 | /** 42 | * Return the definition of the properties of this model. 43 | * 44 | * @return array 45 | */ 46 | protected static function define_properties() { 47 | 48 | return [ 49 | 'id' => [ 50 | 'type' => PARAM_INT, 51 | ], 52 | 'courseid' => [ 53 | 'type' => PARAM_INT, 54 | ], 55 | 'series' => [ 56 | 'type' => PARAM_ALPHANUMEXT, 57 | ], 58 | 'ocinstanceid' => [ 59 | 'type' => PARAM_INT, 60 | 'default' => function () { 61 | return settings_api::get_default_ocinstance()->id; 62 | }, 63 | ], 64 | 'isdefault' => [ 65 | 'type' => PARAM_BOOL, 66 | ], 67 | ]; 68 | } 69 | 70 | /** 71 | * Retrieves a database record of the tool_opencast_series table. 72 | * @param array $filters 73 | * @param false $skipdefault 74 | * @return false|seriesmapping 75 | */ 76 | public static function get_record($filters = [], $skipdefault = false) { 77 | // TODO later deprecate skipdefault and remove this compatibility stuff. 78 | // Keep it compatible with old versions. 79 | if (!$skipdefault && !array_key_exists('isdefault', $filters)) { 80 | $filters['isdefault'] = '1'; 81 | } 82 | 83 | return parent::get_record($filters); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /classes/settings/admin_setting_configeditabletable.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | namespace tool_opencast\settings; 18 | 19 | /** 20 | * Admin setting class which is used to create an editable table. 21 | * 22 | * @package tool_opencast 23 | * @copyright 2021 Tamara Gunkel, University of Münster 24 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 25 | */ 26 | class admin_setting_configeditabletable extends \admin_setting { 27 | /** @var string Id of the div tag */ 28 | private $divid; 29 | 30 | /** 31 | * Not a setting, just an editable table. 32 | * @param string $name Setting name 33 | * @param string $divid Id of the div tag 34 | */ 35 | public function __construct($name, $divid) { 36 | $this->nosave = true; 37 | $this->divid = $divid; 38 | parent::__construct($name, '', '', ''); 39 | } 40 | 41 | /** 42 | * Always returns true 43 | * 44 | * @return bool Always returns true 45 | */ 46 | public function get_setting() { 47 | return true; 48 | } 49 | 50 | /** 51 | * Always returns true 52 | * 53 | * @return bool Always returns true 54 | */ 55 | public function get_defaultsetting() { 56 | return true; 57 | } 58 | 59 | /** 60 | * Never write settings 61 | * 62 | * @param mixed $data Gets converted to str for comparison against yes value 63 | * @return string Always returns an empty string 64 | */ 65 | public function write_setting($data) { 66 | // Do not write any setting. 67 | return ''; 68 | } 69 | 70 | /** 71 | * Returns an HTML string 72 | * 73 | * @param string $data 74 | * @param string $query 75 | * @return string Returns an HTML string 76 | */ 77 | public function output_html($data, $query = '') { 78 | return '
'; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "moodle/tool_opencast", 3 | "require": { 4 | "elan-ev/opencast-api": "1.9.0" 5 | }, 6 | "config": { 7 | "platform-check": false 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /css/styles.css: -------------------------------------------------------------------------------- 1 | div#dateselector-calendar-panel { 2 | /* Set higher than the z-index of the htmleditor */ 3 | z-index: 10 !important; /* stylelint-disable-line */ 4 | } 5 | -------------------------------------------------------------------------------- /db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Capabilities for tool_opencast. 19 | * 20 | * @package tool_opencast 21 | * @copyright 2018 Tobias Reischmann 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | defined('MOODLE_INTERNAL') || die(); 26 | 27 | $capabilities = [ 28 | 29 | 'tool/opencast:instructor' => [ 30 | 'captype' => 'read', 31 | 'contextlevel' => CONTEXT_COURSE, 32 | 'archetypes' => [ 33 | 'editingteacher' => CAP_ALLOW, 34 | ], 35 | ], 36 | 37 | 'tool/opencast:learner' => [ 38 | 'captype' => 'read', 39 | 'contextlevel' => CONTEXT_COURSE, 40 | 'archetypes' => [ 41 | 'student' => CAP_ALLOW, 42 | 'teacher' => CAP_ALLOW, 43 | 'manager' => CAP_ALLOW, 44 | ], 45 | ], 46 | 47 | 'tool/opencast:externalapi' => [ 48 | 'captype' => 'read', 49 | 'contextlevel' => CONTEXT_SYSTEM, 50 | 'archetypes' => [ 51 | ], 52 | ], 53 | ]; 54 | -------------------------------------------------------------------------------- /db/install.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Tool opencast installation. 19 | * 20 | * @package tool_opencast 21 | * @copyright 2021 Tamara Gunkel 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | use tool_opencast\local\settings_api; 26 | 27 | /** 28 | * Initialize settings during install. 29 | */ 30 | function xmldb_tool_opencast_install() { 31 | // Create default instance. 32 | $ocinstance = new \stdClass(); 33 | $ocinstance->id = 1; 34 | $ocinstance->name = 'Default'; 35 | $ocinstance->isvisible = true; 36 | $ocinstance->isdefault = true; 37 | settings_api::set_ocinstances_to_ocinstance($ocinstance); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /db/install.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 | -------------------------------------------------------------------------------- /settings.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Plugin administration pages are defined here. 19 | * 20 | * @package tool_opencast 21 | * @category admin 22 | * @copyright 2022 Matthias Kollenbroich, University of Münster 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 24 | */ 25 | 26 | defined('MOODLE_INTERNAL') || die(); 27 | 28 | use tool_opencast\settings\admin_settings_builder; 29 | 30 | // Check for the moodle/site:config permission. 31 | if ($hassiteconfig) { 32 | admin_settings_builder::create_settings(); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /tests/behat/behat_tool_opencast.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Behat steps definitions for tool opencast. 19 | * 20 | * @package tool_opencast 21 | * @category test 22 | * @copyright 2024 Farbod Zamani Boroujeni, ELAN e.V. 23 | * @author Farbod Zamani Boroujeni 24 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 25 | */ 26 | 27 | // NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. 28 | 29 | use tool_opencast\seriesmapping; 30 | 31 | require_once(__DIR__ . '/../../../../../lib/behat/behat_base.php'); 32 | 33 | /** 34 | * Steps definitions related with the opencast tool API. 35 | * 36 | * @package tool_opencast 37 | * @category test 38 | * @copyright 2024 Farbod Zamani Boroujeni, ELAN e.V. 39 | * @author Farbod Zamani Boroujeni 40 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 41 | */ 42 | class behat_tool_opencast extends behat_base { 43 | 44 | /** 45 | * Setup of block block by creating series mapping. 46 | * 47 | * @Given /^I setup block plugin$/ 48 | */ 49 | public function i_setup_block_plugin() { 50 | $courses = \core_course_category::search_courses(['search' => 'Course 1']); 51 | 52 | $mapping = new seriesmapping(); 53 | $mapping->set('courseid', reset($courses)->id); 54 | $mapping->set('series', '1234-1234-1234-1234-1234'); 55 | $mapping->set('isdefault', '1'); 56 | $mapping->set('ocinstanceid', 1); 57 | $mapping->create(); 58 | } 59 | 60 | /** 61 | * adds a breakpoints in tool 62 | * stops the execution until you hit enter in the console 63 | * 64 | * @Then /^breakpoint in tool/ 65 | */ 66 | public function breakpoint_in_tool() { 67 | fwrite(STDOUT, "\033[s \033[93m[Breakpoint] Press \033[1;93m[RETURN]\033[0;93m to continue...\033[0m"); 68 | while (fgets(STDIN, 1024) == '') { 69 | continue; 70 | } 71 | fwrite(STDOUT, "\033[u"); 72 | return; 73 | } 74 | 75 | /** 76 | * Adds a step to make sure the block drawer keeps opened. 77 | * 78 | * @Given /^I make sure the block drawer keeps opened/ 79 | */ 80 | public function i_make_sure_the_block_drawer_keeps_opened() { 81 | set_user_preference('behat_keep_drawer_closed', 0); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /tests/behat/tool_opencast.feature: -------------------------------------------------------------------------------- 1 | @tool @tool_opencast 2 | Feature: Setup Opencast instances 3 | In order to setup Opencast instances 4 | As an admin 5 | I need to be able to add, edit and delete instances 6 | 7 | @javascript 8 | Scenario: Users should be able to add a new OC instance 9 | Given I log in as "admin" 10 | And I navigate to "Plugins > Admin tools > Opencast API > Opencast Instances" in site administration 11 | And I click on "Add instance" "button" 12 | And I click on "//div[@id='instancestable']//div[@class='tabulator-table']/div[2]/div[@tabulator-field='name']" "xpath" 13 | And I type "Second instance" 14 | And I wait "2" seconds 15 | And I click on "Save changes" "button" 16 | And I navigate to "Plugins > Admin tools > Opencast API" in site administration 17 | Then I should see "Configuration: Default" 18 | And I should see "apiurl" 19 | And I should see "Configuration: Second instance" 20 | And I should see "apiurl_2" 21 | 22 | @javascript 23 | Scenario: Users should not be able to delete the default OC instance 24 | Given I log in as "admin" 25 | And I navigate to "Plugins > Admin tools > Opencast API > Opencast Instances" in site administration 26 | And I click on "//div[@id='instancestable']//i[contains(@class, 'fa-trash')]" "xpath_element" 27 | And I click on "Delete" "button" in the "Delete instance" "dialogue" 28 | And I click on "Save changes" "button" 29 | Then I should see "There must be exactly one default Opencast instance." 30 | And I should see "Some settings were not changed due to an error." 31 | 32 | @javascript 33 | Scenario: Users should able to delete the old OC instance after selecting a new one 34 | Given I log in as "admin" 35 | And the following config values are set as admin: 36 | | config | value | plugin | 37 | | ocinstances | [{"id":1,"name":"OC demo server","isvisible":true,"isdefault":true},{"id":2,"isvisible":1,"isdefault":false,"name":"Invalid server"}] | tool_opencast | 38 | | apiurl_2 | http://notexistent.not | tool_opencast | 39 | And I navigate to "Plugins > Admin tools > Opencast API > Opencast Instances" in site administration 40 | And I click on "//div[@id='instancestable']//div[@class='tabulator-table']/div[1]/div[@tabulator-field='isdefault']" "xpath_element" 41 | And I click on "//div[@id='instancestable']//div[@class='tabulator-table']/div[2]/div[@tabulator-field='isdefault']" "xpath_element" 42 | And I click on "//div[@id='instancestable']//i[contains(@class, 'fa-trash')]" "xpath_element" 43 | And I click on "Delete" "button" in the "Delete instance" "dialogue" 44 | And I click on "Save changes" "button" 45 | Then I should see "Changes saved" 46 | -------------------------------------------------------------------------------- /tests/generator/behat_tool_opencast_generator.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Behat data generator for tool_opencast. 19 | * 20 | * @package tool_opencast 21 | * @category test 22 | * @copyright 2021 Tamara Gunkel, University of Münster 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 24 | */ 25 | 26 | 27 | /** 28 | * Behat data generator for tool_opencast. 29 | * 30 | * @copyright 2021 Tamara Gunkel, University of Münster 31 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 32 | */ 33 | class behat_tool_opencast_generator extends behat_generator_base { 34 | 35 | /** 36 | * Get a list of the entities that can be created for this component. 37 | * This generator supports the creation of series. 38 | * 39 | * @return array[] 40 | */ 41 | protected function get_creatable_entities(): array { 42 | return [ 43 | 'series' => [ 44 | 'singular' => 'series', 45 | 'datagenerator' => 'series', 46 | 'required' => ['course', 'series', 'isdefault', 'ocinstanceid'], 47 | ], 48 | ]; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tests/generator/lib.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Tool opencast test data generator class 19 | * 20 | * @package tool_opencast 21 | * @copyright 2021 Tamara Gunkel, University of Münster 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | /** 26 | * Tool opencast test data generator class 27 | * 28 | * @package tool_opencast 29 | * @copyright 2021 Tamara Gunkel, University of Münster 30 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 31 | */ 32 | class tool_opencast_generator extends testing_module_generator { 33 | 34 | /** 35 | * Create a new series. 36 | * 37 | * @param array $data 38 | * @throws dml_exception 39 | */ 40 | public function create_series($data) { 41 | global $DB; 42 | $courses = $DB->get_records('course', ['shortname' => $data['course']]); 43 | 44 | $series = (object)[ 45 | 'courseid' => reset($courses)->id, 46 | 'series' => $data['series'], 47 | 'isdefault' => $data['isdefault'], 48 | 'ocinstanceid' => $data['ocinstanceid'], 49 | ]; 50 | $DB->insert_record('tool_opencast_series', $series); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /thirdpartylibs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | amd/src/tabulator.js 5 | Tabulator 6 | 4.9.3 7 | MIT 8 | 9 | 10 | 11 | vendor/elan-ev/opencast-api 12 | Opencast PHP Library 13 | 1.8 14 | GPL 15 | 3.0-or-later 16 | 17 | 18 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/composer/InstalledVersions.php', 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 10 | 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 11 | '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', 12 | '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 13 | ); 14 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 10 | 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 11 | 'OpencastApi\\Util\\' => array($vendorDir . '/elan-ev/opencast-api/src/OpencastApi/Util'), 12 | 'OpencastApi\\Rest\\' => array($vendorDir . '/elan-ev/opencast-api/src/OpencastApi/Rest'), 13 | 'OpencastApi\\Mock\\' => array($vendorDir . '/elan-ev/opencast-api/src/OpencastApi/Mock'), 14 | 'OpencastApi\\' => array($vendorDir . '/elan-ev/opencast-api/src/OpencastApi'), 15 | 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 16 | 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 17 | 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 18 | ); 19 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 33 | 34 | $filesToLoad = \Composer\Autoload\ComposerStaticInit8ba2ca4e105ea351f7cb241590a7de7e::$files; 35 | $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { 36 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 37 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 38 | 39 | require $file; 40 | } 41 | }, null, null); 42 | foreach ($filesToLoad as $fileIdentifier => $file) { 43 | $requireFile($fileIdentifier, $file); 44 | } 45 | 46 | return $loader; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/.github/workflows/opencast-php-lib-ci.yml: -------------------------------------------------------------------------------- 1 | name: Opencast PHP Library CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | compatibility: 7 | name: Comaptibility 8 | runs-on: ubuntu-latest 9 | 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | php-version: 14 | - "8.1" 15 | - "8.2" 16 | - "8.3" 17 | dependency-versions: 18 | - "lowest" 19 | - "highest" 20 | 21 | steps: 22 | - name: Repo checkout 23 | uses: actions/checkout@v4 24 | 25 | - name: Setup PHP 26 | uses: shivammathur/setup-php@v2 27 | with: 28 | php-version: ${{ matrix.php-version }} 29 | coverage: none 30 | 31 | - name: Install composer dependencies 32 | uses: ramsey/composer-install@v3 33 | with: 34 | dependency-versions: ${{ matrix.dependency-versions }} 35 | 36 | - name: PHP Compatibility 37 | run: composer sniffer:php${{ matrix.php-version }} 38 | 39 | unittest: 40 | needs: compatibility 41 | name: PHPUnit Test 42 | runs-on: ubuntu-latest 43 | steps: 44 | - name: Repo checkout 45 | uses: actions/checkout@v4 46 | 47 | - name: Setup PHP 48 | uses: shivammathur/setup-php@v2 49 | with: 50 | php-version: 8.1 51 | coverage: none 52 | 53 | - name: Install composer dependencies 54 | uses: ramsey/composer-install@v3 55 | with: 56 | dependency-versions: 8.1 57 | 58 | - name: Run PHPUnit 59 | run: vendor/bin/phpunit --display-incomplete --display-phpunit-deprecations --display-deprecations --display-errors --display-warnings --display-skipped --display-notices 60 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/UPGRADING.md: -------------------------------------------------------------------------------- 1 | Opencast PHP Library Upgrade Guide 2 | ==================== 3 | 4 | 1.1.1 to 1.2.0 5 | ---------- 6 | 7 | From 1.2.0 the base class name "OpencastApi\OpenCast" with capital "C" has been changed to "Opencast", it is highly recommended to apply this change accordingly as it might lead to PHP runtime error in some strict cases! -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elan-ev/opencast-api", 3 | "description": "A comprehensive PHP library for Opencast", 4 | "license": "GPL-3.0-or-later", 5 | "keywords": [ 6 | "Opencast", 7 | "API", 8 | "RESTful" 9 | ], 10 | "authors": [ 11 | { 12 | "name": "Farbod Zamani Boroujeni", 13 | "email": "zamani@elan-ev.de" 14 | } 15 | ], 16 | "support": { 17 | "issues": "https://github.com/elan-ev/opencast-php-library/issues" 18 | }, 19 | "homepage": "https://docs.opencast.org/", 20 | "require": { 21 | "php": ">=7.2.5", 22 | "guzzlehttp/guzzle": ">=7.5.1" 23 | }, 24 | "autoload": { 25 | "psr-4": { 26 | "OpencastApi\\": "src/OpencastApi/", 27 | "OpencastApi\\Rest\\": "src/OpencastApi/Rest/", 28 | "OpencastApi\\Mock\\": "src/OpencastApi/Mock/", 29 | "OpencastApi\\Util\\": "src/OpencastApi/Util/" 30 | } 31 | }, 32 | "scripts": { 33 | "sniffer:php8.0": "phpcs -p -v ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.0", 34 | "sniffer:php8.1": "phpcs -p -v ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.1", 35 | "sniffer:php8.2": "phpcs -p -v ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.2", 36 | "sniffer:php8.3": "phpcs -p -v ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.3" 37 | }, 38 | "require-dev": { 39 | "squizlabs/php_codesniffer": "^3.7", 40 | "phpcompatibility/php-compatibility": "^9.3", 41 | "phpunit/phpunit": "^10.5" 42 | }, 43 | "autoload-dev": { 44 | "psr-4": { 45 | "Tests\\": "tests" 46 | } 47 | }, 48 | "extra": { 49 | "branch-alias": { 50 | "dev-master": "1.0-dev" 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tests/Unit 6 | 7 | 8 | tests/UnitMock 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcAgentsApi.php: -------------------------------------------------------------------------------- 1 | 200, 'body' => '{A (potentially empty) list of agents is returned}'] 21 | */ 22 | public function getAll($limit = 0, $offset = 0) 23 | { 24 | $query = []; 25 | if (!empty($limit)) { 26 | $query['limit'] = intval($limit); 27 | } 28 | if (!empty($offset)) { 29 | $query['offset'] = intval($offset); 30 | } 31 | $options = $this->restClient->getQueryParams($query); 32 | return $this->restClient->performGet(self::URI, $options); 33 | } 34 | 35 | /** 36 | * Returns a single capture agent. 37 | * 38 | * @param string $agentId The agent id 39 | * 40 | * @return array the response result ['code' => 200, 'body' => '{The agent is returned}'] 41 | */ 42 | public function get($agentId) 43 | { 44 | $uri = self::URI . "/$agentId"; 45 | return $this->restClient->performGet($uri); 46 | } 47 | } 48 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcBaseApi.php: -------------------------------------------------------------------------------- 1 | 200, 'body' => '{The api information is returned.}'] 19 | */ 20 | public function get() 21 | { 22 | return $this->restClient->performGet('/api'); 23 | } 24 | 25 | /** 26 | * Returns information on the logged in user. 27 | * 28 | * @return array the response result ['code' => 200, 'body' => '{The api user information is returned.}'] 29 | */ 30 | public function getUserInfo() 31 | { 32 | return $this->restClient->performGet(self::USER_INFO_URI); 33 | } 34 | 35 | /** 36 | * Returns current user's roles. 37 | * 38 | * @return array the response result ['code' => 200, 'body' => '{The set of roles is returned. }'] 39 | */ 40 | public function getUserRole() 41 | { 42 | return $this->restClient->performGet(self::USER_INFO_URI . '/roles'); 43 | } 44 | 45 | /** 46 | * Returns the current organization. 47 | * 48 | * @return array the response result ['code' => 200, 'body' => '{The organization details are returned.}'] 49 | */ 50 | public function getOrg() 51 | { 52 | return $this->restClient->performGet(self::ORGANIZATION_INFO_URI); 53 | } 54 | 55 | /** 56 | * Returns the current organization's properties. 57 | * 58 | * @return array the response result ['code' => 200, 'body' => '{The organization properties are returned.}'] 59 | */ 60 | public function getOrgProps() 61 | { 62 | return $this->restClient->performGet(self::ORGANIZATION_INFO_URI . '/properties'); 63 | } 64 | 65 | /** 66 | * Returns the engage ui url property. 67 | * 68 | * @return array the response result ['code' => 200, 'body' => '{The engage ui url is returned.}'] 69 | */ 70 | public function getOrgEngageUIUrl() 71 | { 72 | return $this->restClient->performGet(self::ORGANIZATION_INFO_URI . '/properties/engageuiurl'); 73 | } 74 | 75 | /** 76 | * Returns a list of available version as well as the default version. 77 | * 78 | * @return array the response result ['code' => 200, 'body' => '{The version list is returned}'] 79 | */ 80 | public function getVersion() 81 | { 82 | return $this->restClient->performGet(self::VERSION_URI); 83 | } 84 | 85 | /** 86 | * Returns the default version. 87 | * 88 | * @return array the response result ['code' => 200, 'body' => '{The default version is returned}'] 89 | */ 90 | public function getDefaultVersion() 91 | { 92 | return $this->restClient->performGet(self::VERSION_URI . '/default'); 93 | } 94 | } 95 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcEventAdminNg.php: -------------------------------------------------------------------------------- 1 | registerHeaderException('Accept', self::URI); 11 | parent::__construct($restClient); 12 | } 13 | 14 | /** 15 | * Delete a single event. 16 | * 17 | * @param string $eventId The id of the event to delete. 18 | * 19 | * @return array the response result ['code' => 200, 'reason' => 'OK'] (OK if the event has been deleted.) 20 | */ 21 | public function delete($eventId) 22 | { 23 | $uri = self::URI . "/{$eventId}"; 24 | return $this->restClient->performDelete($uri); 25 | } 26 | } 27 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcListProvidersApi.php: -------------------------------------------------------------------------------- 1 | 200, 'body' => '{The listproviders are returned as a list.}'] 18 | */ 19 | public function getProviders() 20 | { 21 | if (!$this->restClient->hasVersion('1.10.0')) { 22 | return [ 23 | 'code' => 403, 24 | 'reason' => 'API Version (>= 1.10.0) is required' 25 | ]; 26 | } 27 | $uri = self::URI . "/providers.json"; 28 | return $this->restClient->performGet($uri); 29 | } 30 | 31 | /** 32 | * Provides key-value list from the given listprovider. 33 | * 34 | * @param string $source The provide source name. 35 | * 36 | * @return array the response result ['code' => 200, 'body' => '{The key-value list are returned as a JSON object.}'] 37 | */ 38 | public function getList($source) 39 | { 40 | if (!$this->restClient->hasVersion('1.10.0')) { 41 | return [ 42 | 'code' => 403, 43 | 'reason' => 'API Version (>= 1.10.0) is required' 44 | ]; 45 | } 46 | $uri = self::URI . "/{$source}.json"; 47 | return $this->restClient->performGet($uri); 48 | } 49 | } 50 | ?> 51 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcSecurityApi.php: -------------------------------------------------------------------------------- 1 | 200, 'body' => '{The signed URL}'] 22 | */ 23 | public function sign($url, $validUntil = '', $validSource = '') 24 | { 25 | $uri = self::URI . "/sign"; 26 | $formData = [ 27 | 'url' => $url 28 | ]; 29 | if (!empty($validUntil)) { 30 | $formData['valid-until'] = $validUntil; 31 | } 32 | if (!empty($validSource)) { 33 | $formData['valid-source'] = $validSource; 34 | } 35 | 36 | $options = $this->restClient->getFormParams($formData); 37 | return $this->restClient->performPost($uri, $options); 38 | } 39 | } 40 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcServices.php: -------------------------------------------------------------------------------- 1 | registerHeaderException('Accept', self::URI); 11 | parent::__construct($restClient); 12 | } 13 | 14 | 15 | /** 16 | * Returns a service registraton or list of available service registrations as object (JSON) by default or XML (text) on demand. 17 | * 18 | * @param string $serviceType (optional) The service type identifier 19 | * @param string $host (optional) The host, including the http(s) protocol 20 | * @param string $format (optional) The output format (json or xml) of the response body. (Default value = 'json') 21 | * 22 | * @return array the response result ['code' => 200, 'body' => '{the available service, formatted as xml or json}'] 23 | */ 24 | public function getServiceJSON($serviceType = '', $host = '', $format = '') 25 | { 26 | $uri = self::URI . '/services.json'; 27 | if (!empty($format) && strtolower($format) == 'xml') { 28 | $uri = str_replace('json', 'xml', $uri); 29 | } 30 | 31 | $query = []; 32 | if (!empty($serviceType)) { 33 | $query['serviceType'] = $serviceType; 34 | } 35 | if (!empty($host)) { 36 | $query['host'] = $host; 37 | } 38 | 39 | $options = $this->restClient->getQueryParams($query); 40 | return $this->restClient->performGet($uri, $options); 41 | } 42 | } 43 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcSysinfo.php: -------------------------------------------------------------------------------- 1 | registerHeaderException('Accept', self::URI); 11 | parent::__construct($restClient); 12 | } 13 | 14 | /** 15 | * Return the common OSGi build version and build number of all bundles matching the given prefix. 16 | * 17 | * @param string $prefix (optional) The bundle name prefixes to check. Defaults to 'opencast'. 18 | * 19 | * @return array the response result ['code' => 200, 'body' => '{An object of version structure}'] 20 | */ 21 | public function getVersion($prefix = '') 22 | { 23 | $uri = self::URI . "/bundles/version"; 24 | 25 | $query = []; 26 | if (!empty($prefix)) { 27 | $query['prefix'] = $prefix; 28 | } 29 | 30 | $options = $this->restClient->getQueryParams($query); 31 | return $this->restClient->performGet($uri, $options); 32 | } 33 | } 34 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/src/OpencastApi/Util/OcUtils.php: -------------------------------------------------------------------------------- 1 | $value) { 28 | if ($key === $targetKey) { 29 | return $value; 30 | } elseif (is_array($value) || is_object($value)) { 31 | // Recursively search in nested structures. 32 | $found = self::findValueByKey($value, $targetKey); 33 | if ($found !== null) { 34 | return $found; 35 | } 36 | } 37 | } 38 | 39 | return null; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/EventsDataProvider.php: -------------------------------------------------------------------------------- 1 | true]], 12 | [['withacl' => true]], 13 | [['withmetadata' => true]], 14 | [['withpublications' => true]], 15 | [['withscheduling' => true]], 16 | [['includeInternalPublication' => true]], 17 | [['sort' => ['title' => 'DESC']]], 18 | [['limit' => 2]], 19 | [['offset' => 1, 'limit' => 2]], 20 | [['filter' => ['title' => 'test']]], 21 | ]; 22 | } 23 | 24 | public static function getBySeriesCases(): array 25 | { 26 | return [ 27 | ['ID-openmedia-opencast'], 28 | ]; 29 | } 30 | 31 | public static function createEventCases(): array 32 | { 33 | return [ 34 | [self::getAcls(), self::getMetadata('presenter'), self::getProcessing(), '', self::getPresenterFile(), self::getPresentationFile(), self::getAudioFile()] 35 | ]; 36 | } 37 | 38 | public static function getAcls() 39 | { 40 | return '[{"allow":true,"role":"ROLE_ADMIN","action":"write"},{"allow":true,"role":"ROLE_ADMIN","action":"read"},{"allow":true,"role":"ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS","action":"write"},{"allow":true,"role":"ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS","action":"read"}]'; 41 | } 42 | 43 | public static function getMetadata($title) 44 | { 45 | return '[{"label":"Opencast Event Dublincore","flavor":"dublincore\/episode","fields":[{"id":"title","value":"PHP UNIT TEST_' . strtotime('now') . '_' . strtoupper($title) . '_{update_replace}"},{"id":"subjects","value":["This is default subject"]},{"id":"description","value":"This is a default description for video"},{"id":"startDate","value":"' . date('Y-m-d') . '"},{"id":"startTime","value":"' . date('H:i:s') . 'Z"}]}]'; 46 | } 47 | 48 | public static function getProcessing() 49 | { 50 | return '{"workflow":"schedule-and-upload","configuration":{"flagForCutting":"false","flagForReview":"false","publishToEngage":"true","publishToHarvesting":"false","straightToPublishing":"true"}}'; 51 | } 52 | 53 | public static function getPresentationFile() 54 | { 55 | return Psr7\Utils::tryFopen(__DIR__ . '/test_files/video_test.mp4', 'r'); 56 | } 57 | 58 | public static function getPresenterFile() 59 | { 60 | return Psr7\Utils::tryFopen(__DIR__ . '/test_files/video_test.mp4', 'r'); 61 | } 62 | 63 | public static function getAudioFile() 64 | { 65 | return Psr7\Utils::tryFopen(__DIR__ . '/test_files/audio_test.mp3', 'r'); 66 | } 67 | 68 | public static function getVttFile($lang = 'de', $overwrite = false) 69 | { 70 | $lang = strtolower($lang); 71 | $overwitestr = $overwrite ? '_overwrite' : ''; 72 | $filename = "/test_files/video_test{$overwitestr}_{$lang}.vtt"; 73 | return Psr7\Utils::tryFopen(__DIR__ . $filename, 'r'); 74 | } 75 | } 76 | ?> 77 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/GroupsDataProvider.php: -------------------------------------------------------------------------------- 1 | 'DESC'], 0, 0, []], 10 | [[], 4, 0, []], 11 | [[], 2, 2, []], 12 | [[], 0, 0, ['name' => '"phpunit_testing_group"']], 13 | ]; 14 | } 15 | } 16 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/IngestDataProvider.php: -------------------------------------------------------------------------------- 1 | 'DESC'], 0, 0, []], 14 | [true, true, ['workflow_definition_identifier' => 'DESC'], 2, 0, []], 15 | [true, true, ['workflow_definition_identifier' => 'DESC'], 2, 1, []], 16 | [true, true, [], 0, 0, ['workflow_definition_identifier' => 'fast']], 17 | ]; 18 | } 19 | 20 | public static function getDCCatalog() 21 | { 22 | return file_get_contents(__DIR__ . '/test_files/dublincore-episode.xml'); 23 | } 24 | 25 | public static function getEpisodeXMLFile() 26 | { 27 | return Psr7\Utils::tryFopen(__DIR__ . '/test_files/dublincore-episode.xml', 'r'); 28 | } 29 | 30 | public static function getPresentationFile() 31 | { 32 | return Psr7\Utils::tryFopen(__DIR__ . '/test_files/video_test.mp4', 'r'); 33 | } 34 | 35 | public static function getPresentationUrl() 36 | { 37 | return ''; 38 | } 39 | 40 | public static function getPresenterFile() 41 | { 42 | return Psr7\Utils::tryFopen(__DIR__ . '/test_files/video_test.mp4', 'r'); 43 | } 44 | 45 | public static function getPresenterUrl() 46 | { 47 | return ''; 48 | } 49 | 50 | public static function getEpisodeAclXMLFile() 51 | { 52 | return Psr7\Utils::tryFopen(__DIR__ . '/test_files/xacml-episode.xml', 'r'); 53 | } 54 | 55 | public static function getCatalogURL() 56 | { 57 | return ''; 58 | } 59 | 60 | public static function getAttachmentURL() 61 | { 62 | return ''; 63 | } 64 | 65 | public static function getTrackURL() 66 | { 67 | return ''; 68 | } 69 | } 70 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/PlaylistsDataProvider.php: -------------------------------------------------------------------------------- 1 | 'updated:DESC']], 11 | [['limit' => 2]], 12 | [['offset' => 1]], 13 | ]; 14 | } 15 | 16 | public static function getPlaylist() 17 | { 18 | return '{"title":"Opencast Playlist","description":"PHP UNIT TEST_' . strtotime('now') . '_{update_replace}","creator":"Opencast","entries":[{"contentId":"ID-about-opencast","type":"EVENT"}],"accessControlEntries":[{"allow":true,"role":"ROLE_USER_BOB","action":"read"}]}'; 19 | } 20 | 21 | public static function getEntries() 22 | { 23 | return json_decode('[{"contentId":"ID-about-opencast","type":"EVENT"},{"contentId":"ID-3d-print","type":"EVENT"}]'); 24 | } 25 | } 26 | ?> 27 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/SearchDataProvider.php: -------------------------------------------------------------------------------- 1 | 'ID-spring'], ''], 11 | [['sid' => '8010876e-1dce-4d38-ab8d-24b956e3d8b7'], ''], 12 | [['sname' => 'HUB_LOCAL_TEST'], ''], 13 | [['sort' => 'modified asc'], ''], 14 | [['offset' => 1], ''], 15 | [['limit' => 1], ''], 16 | [['admin' => true], ''], 17 | [['sign' => true], ''], 18 | ]; 19 | } 20 | 21 | public static function getLuceneQueryCases(): array 22 | { 23 | return [ 24 | [[], 'json'], 25 | [[], 'xml'], 26 | [[], 'XML'], 27 | [['series' => true], ''], 28 | [['sort' => 'DATE_CREATED_DESC'], ''], 29 | [['offset' => 1], ''], 30 | [['limit' => 1], ''], 31 | [['admin' => true], ''], 32 | [['sign' => true], ''], 33 | ]; 34 | } 35 | 36 | public static function getSeriesQueryCases(): array 37 | { 38 | return [ 39 | [[], 'json'], 40 | [['id' => '8010876e-1dce-4d38-ab8d-24b956e3d8b7'], ''], 41 | [['episodes' => true], ''], 42 | [['sort' => 'modified desc'], ''], 43 | [['offset' => 1], ''], 44 | [['limit' => 1], ''], 45 | [['admin' => true], ''], 46 | [['sign' => true], ''], 47 | ]; 48 | } 49 | } 50 | ?> 51 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/SeriesDataProvider.php: -------------------------------------------------------------------------------- 1 | true]], 11 | [['sort' => ['title' => 'DESC']]], 12 | [['limit' => 2]], 13 | [['offset' => 1]], 14 | [['filter' => ['title' => 'test']]], 15 | ]; 16 | } 17 | 18 | public static function getAcl() 19 | { 20 | return '[{"allow":true,"role":"ROLE_ADMIN","action":"write"},{"allow":true,"role":"ROLE_ADMIN","action":"read"},{"allow":true,"role":"ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS","action":"write"},{"allow":true,"role":"ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS","action":"read"}]'; 21 | } 22 | 23 | public static function getMetadata() 24 | { 25 | return '[{"label":"Opencast Series Dublincore","flavor":"dublincore\/series","fields":[{"id":"title","value":"PHP UNIT TEST_' . strtotime('now') . '_{update_replace}"},{"id":"subjects","value":["This is default subject"]},{"id":"description","value":"This is a default description for series"}]}]'; 26 | } 27 | 28 | public static function getDCMetadata() 29 | { 30 | return '[{"id":"title","value":"PHP UNIT TEST_' . strtotime('now') . '_{update_replace}"},{"id":"subject","value":""},{"id":"description","value":"aaa"},{"id":"language","value":""},{"id":"rightsHolder","value":""},{"id":"license","value":""},{"id":"creator","value":[]},{"id":"contributor","value":[]}]'; 31 | } 32 | 33 | public static function getTheme() 34 | { 35 | return ''; 36 | } 37 | 38 | public static function getProperties() 39 | { 40 | return '{"ondemand": "true","live": "false"}'; 41 | } 42 | } 43 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/SetupDataProvider.php: -------------------------------------------------------------------------------- 1 | $url, 15 | 'username' => $username, 16 | 'password' => $password, 17 | 'timeout' => $timeout, 18 | 'version' => '1.11.0', 19 | 'connect_timeout' => $connectTimeout, 20 | 'features' => [ 21 | 'lucene' => false 22 | ] 23 | ]; 24 | if (!empty($version)) { 25 | $config['version'] = $version; 26 | } 27 | return $config; 28 | } 29 | 30 | public static function getMockResponses($data): array 31 | { 32 | $responseNames = []; 33 | if (!is_array($data)) { 34 | $responseNames[] = $data; 35 | } else { 36 | $responseNames = $data; 37 | } 38 | $mockResponse = []; 39 | $mockResponsesDir = __DIR__ . "/mock_responses"; 40 | foreach ($responseNames as $fileName) { 41 | $fileFullName = basename($fileName, ".json") . '.json'; 42 | $filePath = $mockResponsesDir . "/" . $fileFullName; 43 | if (file_exists($filePath)) { 44 | $responseStr = file_get_contents($filePath); 45 | $mockResponse = array_merge($mockResponse, json_decode($responseStr, true)); 46 | } 47 | } 48 | return $mockResponse !== false ? $mockResponse : []; 49 | } 50 | } 51 | ?> 52 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/StatisticsDataProvider.php: -------------------------------------------------------------------------------- 1 | 'episode'], false], 12 | [['resourceType' => 'episode'], true], 13 | [['resourceType' => 'series'], false], 14 | [['resourceType' => 'series'], true], 15 | [['resourceType' => 'organization'], false], 16 | [['resourceType' => 'organization'], true], 17 | ]; 18 | } 19 | 20 | public static function getProviderId(): array 21 | { 22 | return [ 23 | ['a-timeseries-provider'] 24 | ]; 25 | } 26 | 27 | public static function getStatisticalData(): array 28 | { 29 | return [ 30 | ['[{"provider":{"identifier":"a-statistics-provider"},"parameters":{"resourceId":"93213324-5d29-428d-bbfd-369a2bae6700"}},{"provider":{"identifier":"a-timeseries-provider"},"parameters":{"resourceId":"23413432-5a15-328e-aafe-562a2bae6800","from":"2019-04-10T13:45:32Z","to":"2019-04-12T00:00:00Z","dataResolution":"daily"}}]'] 31 | ]; 32 | } 33 | 34 | public static function getStatisticalDataCVS(): array 35 | { 36 | return [ 37 | ['[]', [], 0, 0], 38 | ['[{"parameters":{"resourceId":"mh_default_org","detailLevel":"EPISODE","from":"2018-12-31T23:00:00.000Z","to":"2019-12-31T22:59:59.999Z","dataResolution":"YEARLY"},"provider":{"identifier":"organization.views.sum.influx","resourceType":"organization"}}]', [], 0, 0], 39 | ['[{"parameters":{"resourceId":"mh_default_org","detailLevel":"EPISODE","from":"2018-12-31T23:00:00.000Z","to":"2019-12-31T22:59:59.999Z","dataResolution":"YEARLY"},"provider":{"identifier":"organization.views.sum.influx","resourceType":"organization"}}]', [], 2, 0], 40 | ['[{"parameters":{"resourceId":"mh_default_org","detailLevel":"EPISODE","from":"2018-12-31T23:00:00.000Z","to":"2019-12-31T22:59:59.999Z","dataResolution":"YEARLY"},"provider":{"identifier":"organization.views.sum.influx","resourceType":"organization"}}]', [], 4, 1], 41 | ['[{"parameters":{"resourceId":"mh_default_org","detailLevel":"EPISODE","from":"2018-12-31T23:00:00.000Z","to":"2019-12-31T22:59:59.999Z","dataResolution":"YEARLY"},"provider":{"identifier":"organization.views.sum.influx","resourceType":"organization"}}]', ['presenters' => 'Hans Dampf'], 0, 0] 42 | ]; 43 | } 44 | } 45 | ?> -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/WorkflowDataProvider.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/WorkflowsApiDataProvider.php: -------------------------------------------------------------------------------- 1 | true]], 11 | [['withconfigurationpanel' => true]], 12 | [['withconfigurationpaneljson' => true]], 13 | [['sort' => ['identifier' => 'DESC']]], 14 | [['limit' => 2]], 15 | [['offset' => 1]], 16 | [['filter' => ['tag' => 'schedule']]], 17 | ]; 18 | } 19 | } 20 | ?> 21 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/mock_responses/api_agents.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api/agents?limit=4": { 3 | "GET": [ 4 | { 5 | "body": "[{\"agent_id\":\"ca24\",\"status\":\"offline\",\"inputs\":[\"default\"],\"update\":\"2018-03-12T18:17:25Z\",\"url\":\"127.0.0.1\"}]", 6 | "params": "", 7 | "status": 200 8 | } 9 | ] 10 | }, 11 | "/api/agents/ca24": { 12 | "GET": [ 13 | { 14 | "body": "{\"agent_id\":\"ca24\",\"status\":\"offline\",\"inputs\":[\"default\"],\"update\":\"2018-03-12T18:17:25Z\",\"url\":\"127.0.0.1\"}", 15 | "params": "", 16 | "status": 200 17 | } 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/mock_responses/api_groups.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api/groups": { 3 | "GET": [ 4 | { 5 | "body": "[{\"identifier\":\"MH_DEFAULT_ORG_SYSTEM_ADMINS\",\"role\":\"ROLE_GROUP_MH_DEFAULT_ORG_SYSTEM_ADMINS\",\"organization\":\"mh_default_org\",\"roles\":\"ROLE_SUDO,ROLE_OAUTH_USER,ROLE_ADMIN,ROLE_ANONYMOUS\",\"members\":\"admin\",\"name\":\"Opencast Project System Administrators\",\"description\":\"System administrators of 'Opencast Project'\"}]", 6 | "params": "", 7 | "status": 200 8 | } 9 | ], 10 | "POST": [ 11 | { 12 | "body": "", 13 | "status": 201 14 | } 15 | ] 16 | }, 17 | "/api/groups/PHPUNIT_TESTING_GROUP": { 18 | "GET": [ 19 | { 20 | "body": "{\"identifier\":\"PHPUNIT_TESTING_GROUP\",\"role\":\"ROLE_GROUP_MH_DEFAULT_ORG_SYSTEM_ADMINS\",\"organization\":\"mh_default_org\",\"roles\":\"ROLE_SUDO,ROLE_OAUTH_USER,ROLE_ADMIN,ROLE_ANONYMOUS\",\"members\":\"admin\",\"name\":\"Opencast Project System Administrators\",\"description\":\"System administrators of 'Opencast Project'\"}", 21 | "params": "", 22 | "status": 200 23 | } 24 | ], 25 | "PUT": [ 26 | { 27 | "body": "", 28 | "params": "", 29 | "status": 200 30 | } 31 | ], 32 | "DELETE": [ 33 | { 34 | "body": "", 35 | "params": "", 36 | "status": 204 37 | } 38 | ] 39 | }, 40 | "/api/groups/PHPUNIT_TESTING_GROUP/members": { 41 | "POST": [ 42 | { 43 | "body": "", 44 | "params": { 45 | "unique_request_identifier": "opencast_capture_agent" 46 | }, 47 | "status": 200 48 | }, 49 | { 50 | "body": "", 51 | "params": { 52 | "unique_request_identifier": "opencast_capture_agent_2" 53 | }, 54 | "status": 204 55 | } 56 | ] 57 | }, 58 | "/api/groups/PHPUNIT_TESTING_GROUP/members/opencast_capture_agent": { 59 | "DELETE": [ 60 | { 61 | "body": "", 62 | "params": "", 63 | "status": 200 64 | } 65 | ] 66 | } 67 | } -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/mock_responses/api_security.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api/security/sign": { 3 | "POST": [ 4 | { 5 | "body": "", 6 | "params": "", 7 | "status": 200 8 | } 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/mock_responses/api_statistics.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "/api/statistics/providers?withparameters=false": { 4 | "GET": [ 5 | { 6 | "body": "[]", 7 | "params": "", 8 | "status": 200 9 | } 10 | ] 11 | }, 12 | "/api/statistics/providers/a-timeseries-provider": { 13 | "GET": [ 14 | { 15 | "body": "", 16 | "params": "", 17 | "status": 200 18 | } 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/mock_responses/api_workflows.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api/events": { 3 | "GET": [ 4 | { 5 | "body": "[{\"identifier\": \"ID-3d-print\",\"creator\": \"Administrator\",\"presenter\": [\"Lars Kiesow\"],\"created\": \"2021-04-17T17:22:40Z\",\"is_part_of\": \"ID-openmedia-opencast\",\"subjects\": [],\"start\": \"2021-04-17T17:22:40Z\",\"description\": \"\",\"language\": \"\",\"source\": \"https://data.lkiesow.io\",\"title\": \"3D Print\",\"processing_state\": \"SUCCEEDED\",\"duration\": null,\"license\": \"CC0\",\"archive_version\": 1,\"contributor\": [],\"series\": \"Open Media for Opencast\",\"has_previews\": true,\"location\": \"\",\"rightsholder\": \"\",\"publication_status\": [\"internal\",\"engage-player\"],\"status\": \"EVENTS.EVENTS.STATUS.PROCESSED\"}]", 6 | "params": "", 7 | "status": 200 8 | } 9 | ] 10 | }, 11 | "/api/workflow-definitions": { 12 | "GET": [ 13 | { 14 | "body": "[{\"identifier\":\"noop\",\"description\":\"\",\"title\":\"Do nothing (mostly for debugging and maintenance purposes)\",\"tags\":[]}]", 15 | "params": "", 16 | "status": 200 17 | } 18 | ] 19 | }, 20 | "/api/workflow-definitions/noop?withoperations=true&withconfigurationpanel=true&withconfigurationpaneljson=false": { 21 | "GET": [ 22 | { 23 | "body": "{\"identifier\":\"noop\",\"description\":\"\",\"title\":\"Do nothing (mostly for debugging and maintenance purposes)\",\"tags\":[]}", 24 | "params": "", 25 | "status": 200 26 | } 27 | ] 28 | }, 29 | "/api/workflows?withoperations=false&withconfiguration=false": { 30 | "POST": [ 31 | { 32 | "body": "{\"identifier\":\"wkf-running\"}", 33 | "params": "", 34 | "status": 201 35 | } 36 | ] 37 | }, 38 | "/api/workflows/wkf-running?withoperations=false&withconfiguration=false": { 39 | "PUT": [ 40 | { 41 | "body": "", 42 | "params": "", 43 | "status": 200 44 | } 45 | ], 46 | "DELETE": [ 47 | { 48 | "body": "", 49 | "params": "", 50 | "status": 204 51 | } 52 | ] 53 | }, 54 | "/api/workflows/wkf-running": { 55 | "DELETE": [ 56 | { 57 | "body": "", 58 | "params": "", 59 | "status": 204 60 | } 61 | ] 62 | }, 63 | "/api/workflows/wkf-running?withoperations=true&withconfiguration=true": { 64 | "GET": [ 65 | { 66 | "body": "", 67 | "params": "", 68 | "status": 200 69 | } 70 | ] 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/mock_responses/search.json: -------------------------------------------------------------------------------- 1 | { 2 | "/search/episode.json?sid=8010876e-1dce-4d38-ab8d-24b956e3d8b7": { 3 | "GET": [ 4 | { 5 | "body": "", 6 | "params": "", 7 | "status": 200 8 | } 9 | ] 10 | }, 11 | "/search/lucene.json?series=true": { 12 | "GET": [ 13 | { 14 | "body": "", 15 | "params": "", 16 | "status": 200 17 | } 18 | ] 19 | }, 20 | "/search/series.json?episodes=true": { 21 | "GET": [ 22 | { 23 | "body": "", 24 | "params": "", 25 | "status": 200 26 | } 27 | ] 28 | } 29 | } -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/mock_responses/services.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "/services/services.json": { 4 | "GET": [ 5 | { 6 | "body": "{\"services\":{\"service\":[{\"type\":\"org.opencastproject.ingest\",\"host\":\"https://stable.opencast.org\",\"path\":\"/ingest\",\"active\":true,\"online\":true,\"maintenance\":false,\"jobproducer\":true,\"onlinefrom\":\"2023-04-06T02:01:58.005+02:00\",\"service_state\":\"NORMAL\",\"state_changed\":\"2023-04-06T02:01:58.005+02:00\",\"error_state_trigger\":0,\"warning_state_trigger\":0}]}}", 7 | "params": "", 8 | "status": 200 9 | } 10 | ] 11 | }, 12 | "/services/services.json?serviceType=org.opencastproject.ingest": { 13 | "GET": [ 14 | { 15 | "body": "{\"services\":{\"service\":{\"type\":\"org.opencastproject.ingest\",\"host\":\"https://stable.opencast.org\",\"path\":\"/ingest\",\"active\":true,\"online\":true,\"maintenance\":false,\"jobproducer\":true,\"onlinefrom\":\"2023-04-06T02:01:58.005+02:00\",\"service_state\":\"NORMAL\",\"state_changed\":\"2023-04-06T02:01:58.005+02:00\",\"error_state_trigger\":0,\"warning_state_trigger\":0}}}", 16 | "params": "", 17 | "status": 200 18 | } 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/mock_responses/sysinfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "/sysinfo/bundles/version": { 3 | "GET": [ 4 | { 5 | "body": "{\"versions\":[{\"version\":\"1.6.7\"},{\"version\":\"2.3.2.1\"},{\"version\":\"2.6.10\"},{\"version\":\"1.2.18.1\"},{\"version\":\"1.0.0.201505202023\"},{\"version\":\"1.3.1.RELEASE\"},{\"version\":\"1.1.0.1\"},{\"version\":\"1.1.1\"},{\"version\":\"2.3.0\"},{\"version\":\"1.0.0\"},{\"version\":\"1.26.0\"},{\"version\":\"1.4.0\"},{\"version\":\"1.2.2\"},{\"version\":\"1.10.0\"},{\"version\":\"1.5.1\"},{\"version\":\"4.20.0\"},{\"version\":\"4.4.15\"},{\"version\":\"2.13.2\"},{\"version\":\"1.2.0.202109301733\"},{\"version\":\"3.12.0\"},{\"version\":\"9.3.0\"},{\"version\":\"4.5.13\"},{\"version\":\"2.12.1.1\"},{\"version\":\"2.8.9\"},{\"version\":\"3.0.1\"},{\"version\":\"3.2.4.1\"},{\"version\":\"3.11.1.v20150902-1521\"},{\"version\":\"1.2.0.1\"},{\"version\":\"9.4.43.v20210629\"},{\"version\":\"1.30.0\"},{\"version\":\"3.19.0\"},{\"version\":\"2.7.3\"},{\"version\":\"2.1.30\"},{\"version\":\"2.9.1\"},{\"version\":\"1.2.1\"},{\"version\":\"1.1.0\"},{\"version\":\"2.8.0\"},{\"version\":\"3.4.6\"},{\"version\":\"3.1.4.RELEASE\"},{\"version\":\"5.6.12\"},{\"version\":\"1.3.2\"},{\"version\":\"4.2.1\"},{\"version\":\"1.9.0\"},{\"version\":\"13.0.0.SNAPSHOT\",\"buildNumber\":\"a0b6211\"},{\"version\":\"9.0.0.v202010211629\"},{\"version\":\"1.21.0\"},{\"version\":\"1.9.24\"},{\"version\":\"1.10.3\"},{\"version\":\"1.15.0\"},{\"version\":\"3.0.0\"},{\"version\":\"0.2.4\"},{\"version\":\"2.4.3\"},{\"version\":\"2.2.5\"},{\"version\":\"1.2.0\"},{\"version\":\"1.0.2\"},{\"version\":\"2.0.0.SP1\"},{\"version\":\"1.4.0.1\"},{\"version\":\"3.7.4\"},{\"version\":\"4.4.0\"},{\"version\":\"1.2.4\"},{\"version\":\"1.0.0.2\"},{\"version\":\"1.4.2\"},{\"version\":\"1.1.3\"},{\"version\":\"4.2.16\"},{\"version\":\"1.1.12\"},{\"version\":\"2.6.0.2\"},{\"version\":\"30.1.1.jre\"},{\"version\":\"1.3.5\"},{\"version\":\"2.10.10\"},{\"version\":\"2.2.0.v201708071007\"},{\"version\":\"2.11.4\"},{\"version\":\"1.6.3.1\"},{\"version\":\"1.18.0\"},{\"version\":\"3.0.7\"},{\"version\":\"1.12.269.1\"},{\"version\":\"3.1.0.7\"},{\"version\":\"7.2.29\"},{\"version\":\"3.1.0\"},{\"version\":\"1.7.0.3\"},{\"version\":\"5.2.0.3\"},{\"version\":\"0.5.0\"},{\"version\":\"1.8.5.1\"},{\"version\":\"2.3.1\"},{\"version\":\"1.4.3.1\"},{\"version\":\"1.0.1\"},{\"version\":\"2.7.8.v20201217-ecdf3c32c4\"},{\"version\":\"1.11.15\"},{\"version\":\"2.6.0\"},{\"version\":\"1.11.0\"},{\"version\":\"3.1.7.RELEASE\"},{\"version\":\"1.3.4\"},{\"version\":\"6.2.6\"},{\"version\":\"3.5.2.v201711011707\"},{\"version\":\"4.21.0\"}],\"consistent\":false}", 6 | "params": "", 7 | "status": 200 8 | } 9 | ] 10 | }, 11 | "/sysinfo/bundles/version?prefix=opencast": { 12 | "GET": [ 13 | { 14 | "body": "{\"last-modified\":1680739275191,\"consistent\":true,\"version\":\"13.0.0.SNAPSHOT\",\"buildNumber\":\"a0b6211\"}", 15 | "params": "", 16 | "status": 200 17 | } 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/test_files/audio_test.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opencast-Moodle/moodle-tool_opencast/950c7417a56cca77afcc9eff6a4c28027a17fe5f/vendor/elan-ev/opencast-api/tests/DataProvider/test_files/audio_test.mp3 -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/test_files/dublincore-episode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | PHP UNIT TEST INGEST 4 | PHPUNIT TEST SUBJECT 5 | PHPUNIT TEST DESCRIPTION 6 | 7 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/test_files/video_test.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opencast-Moodle/moodle-tool_opencast/950c7417a56cca77afcc9eff6a4c28027a17fe5f/vendor/elan-ev/opencast-api/tests/DataProvider/test_files/video_test.mp4 -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/test_files/video_test_de.vtt: -------------------------------------------------------------------------------- 1 | WEBVTT FILE 2 | 3 | 1 4 | 00:00:00.500 --> 00:00:01.000 D:vertical A:start 5 | MOIN MOIN 6 | 7 | 2 8 | 00:00:01.001 --> 00:00:01.200 A:start 9 | Es ist ein Test 10 | 11 | 3 12 | 00:00:01.200 --> 00:00:01.300 A:end 13 | Es ist ein Test. 14 | 15 | 4 16 | 00:00:01.300 --> 00:00:01.400 17 | Es ist ein Test.. 18 | 19 | 5 20 | 00:00:01.400 --> 00:00:01.500 21 | Es ist ein Test... 22 | 23 | 6 24 | 00:00:01.500 --> 00:00:01.900 25 | Es ist ein Test.... 26 | 27 | 7 28 | 00:00:01.900 --> 00:00:02.000 29 | FERTIG! 30 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/test_files/video_test_en.vtt: -------------------------------------------------------------------------------- 1 | WEBVTT FILE 2 | 3 | 1 4 | 00:00:00.500 --> 00:00:01.000 D:vertical A:start 5 | Hello There 6 | 7 | 2 8 | 00:00:01.001 --> 00:00:01.200 A:start 9 | It is a test 10 | 11 | 3 12 | 00:00:01.200 --> 00:00:01.300 A:end 13 | It is a test. 14 | 15 | 4 16 | 00:00:01.300 --> 00:00:01.400 17 | It is a test.. 18 | 19 | 5 20 | 00:00:01.400 --> 00:00:01.500 21 | It is a test... 22 | 23 | 6 24 | 00:00:01.500 --> 00:00:01.900 25 | It is a test.... 26 | 27 | 7 28 | 00:00:01.900 --> 00:00:02.000 29 | DONE! 30 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/DataProvider/test_files/video_test_overwrite_de.vtt: -------------------------------------------------------------------------------- 1 | WEBVTT FILE 2 | 3 | 1 4 | 00:00:00.500 --> 00:00:01.000 D:vertical A:start 5 | MOIN MOIN [OVERWRITE] 6 | 7 | 2 8 | 00:00:01.001 --> 00:00:01.200 A:start 9 | Es ist ein Test [OVERWRITE] 10 | 11 | 3 12 | 00:00:01.200 --> 00:00:01.300 A:end 13 | Es ist ein Test. [OVERWRITE] 14 | 15 | 4 16 | 00:00:01.300 --> 00:00:01.400 17 | Es ist ein Test.. [OVERWRITE] 18 | 19 | 5 20 | 00:00:01.400 --> 00:00:01.500 21 | Es ist ein Test... [OVERWRITE] 22 | 23 | 6 24 | 00:00:01.500 --> 00:00:01.900 25 | Es ist ein Test.... [OVERWRITE] 26 | 27 | 7 28 | 00:00:01.900 --> 00:00:02.000 29 | FERTIG! [OVERWRITE] 30 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Results/progress.txt: -------------------------------------------------------------------------------- 1 | 100 -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Results/progress_ingest.txt: -------------------------------------------------------------------------------- 1 | 100 -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Unit/OcAgentsApiTest.php: -------------------------------------------------------------------------------- 1 | ocAgentsApi = $ocRestApi->agentsApi; 18 | } 19 | 20 | /** 21 | * @test 22 | */ 23 | public function get_agents(): void 24 | { 25 | $responseAll = $this->ocAgentsApi->getAll(4, 0); 26 | $this->assertSame(200, $responseAll['code'], 'failure to get agent list'); 27 | $agents = $responseAll['body']; 28 | if (!empty($agents)) { 29 | $agent = $agents[array_rand($agents)]; 30 | $responseOne = $this->ocAgentsApi->get($agent->agent_id); 31 | $this->assertSame(200, $responseOne['code'], 'failure to get agent'); 32 | } else { 33 | $this->markTestIncomplete('No agents to complete the test!'); 34 | } 35 | } 36 | } 37 | ?> 38 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Unit/OcListProvidersApiTest.php: -------------------------------------------------------------------------------- 1 | ocListProvidersApi = $ocRestApi->listProvidersApi; 18 | } 19 | 20 | /** 21 | * @test 22 | */ 23 | public function get_providers_and_provider_list(): void 24 | { 25 | $response = $this->ocListProvidersApi->getProviders(); 26 | $this->assertSame(200, $response['code'], 'failure to get providers list'); 27 | $providers = $response['body']; 28 | if (!empty($providers) && is_array($providers)) { 29 | $providers = count($providers) == 1 ? reset($providers) : $providers; 30 | $provider = $providers[array_rand($providers)]; 31 | $responseList = $this->ocListProvidersApi->getList($provider); 32 | $this->assertSame(200, $responseList['code'], 'failure to get provider list'); 33 | } else { 34 | $this->markTestIncomplete('No provider to complete the test!'); 35 | } 36 | } 37 | } 38 | ?> 39 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Unit/OcRestClientWithGuzzleOptionTest.php: -------------------------------------------------------------------------------- 1 | true, 17 | 'query' => ['limit' => 1], 18 | 'auth' => [ 19 | $config['username'], $config['password'] 20 | ] 21 | ]; 22 | $ocRestApi = new Opencast($config, [], false); 23 | $this->ocBaseApi = $ocRestApi->baseApi; 24 | $this->ocEventApi = $ocRestApi->eventsApi; 25 | 26 | $config['guzzle']['auth'] = [ 27 | 'faulty', 'faulty' 28 | ]; 29 | $ocRestApiFaulty = new Opencast($config, [], false); 30 | $this->ocBaseApiFaulty = $ocRestApiFaulty->baseApi; 31 | } 32 | 33 | /** 34 | * @test 35 | */ 36 | public function get(): void 37 | { 38 | $response = $this->ocBaseApi->get(); 39 | $this->assertSame(200, $response['code'], 'Failure to get base info'); 40 | } 41 | 42 | /** 43 | * @test 44 | */ 45 | public function get_events_overwrite_guzzle_option(): void 46 | { 47 | $response = $this->ocEventApi->getAll(['limit' => 4]); 48 | $this->assertSame(200, $response['code'], 'Failure to get events'); 49 | $this->assertSame(4, count($response['body']), 'Failure to get specifically 4 events.'); 50 | } 51 | 52 | /** 53 | * @test 54 | */ 55 | public function get_faulty(): void 56 | { 57 | $response = $this->ocBaseApiFaulty->get(); 58 | $this->assertSame(401, $response['code'], 'Failure to overwrite default option!'); 59 | } 60 | 61 | /** 62 | * @test 63 | */ 64 | public function get_no_auth(): void 65 | { 66 | $response = $this->ocBaseApi->noHeader()->get(); 67 | $this->assertSame(200, $response['code'], 'Failure to get base info'); 68 | $this->assertSame(true, is_object($response['body']), 'Failure to get base info correctly'); 69 | } 70 | } 71 | ?> 72 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Unit/OcSearchTest.php: -------------------------------------------------------------------------------- 1 | ocSearch = $ocRestApi->search; 18 | } 19 | 20 | /** 21 | * @test 22 | * @dataProvider \Tests\DataProvider\SearchDataProvider::getEpisodeQueryCases() 23 | */ 24 | public function get_eposides($params, $format): void 25 | { 26 | $response = $this->ocSearch->getEpisodes($params, $format); 27 | $this->assertSame(200, $response['code'], 'Failure to search episode'); 28 | } 29 | 30 | /** 31 | * @test 32 | */ 33 | public function find_mediapackage_using_ocutils() { 34 | $params = ['id' => 'ID-spring']; 35 | $response = $this->ocSearch->getEpisodes($params); 36 | $this->assertSame(200, $response['code'], 'Failure to search episode for OcUtils'); 37 | $mediapackage = OcUtils::findValueByKey($response['body'], 'mediapackage'); 38 | $this->assertNotEmpty($mediapackage, 'Cannot extract mediapackage from response using "OcUtils::findValueByKey"'); 39 | } 40 | 41 | /** 42 | * @test 43 | * @dataProvider \Tests\DataProvider\SearchDataProvider::getSeriesQueryCases() 44 | */ 45 | public function get_series($params, $format): void 46 | { 47 | $response = $this->ocSearch->getSeries($params, $format); 48 | $this->assertSame(200, $response['code'], 'Failure to search series'); 49 | } 50 | 51 | /** 52 | * @test 53 | * @dataProvider \Tests\DataProvider\SearchDataProvider::getLuceneQueryCases() 54 | */ 55 | public function get_lucenes($params, $format): void 56 | { 57 | $response = $this->ocSearch->getLucene($params, $format); 58 | $this->assertContains($response['code'], [200, 410], 'Failure to create an event'); 59 | } 60 | } 61 | ?> 62 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Unit/OcSecurityApiTest.php: -------------------------------------------------------------------------------- 1 | ocSecurityApi = $ocRestApi->securityApi; 17 | } 18 | 19 | /** 20 | * @test 21 | */ 22 | public function sign(): void 23 | { 24 | $url = 'https://stable.opencast.org/'; 25 | $validUntil = '2022-12-29T23:59:59Z'; 26 | $response = $this->ocSecurityApi->sign($url, $validUntil); 27 | $this->assertSame(200, $response['code'], 'Failure to sign in security api'); 28 | } 29 | } 30 | ?> 31 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Unit/OcServicesTest.php: -------------------------------------------------------------------------------- 1 | ocServices = $ocRestApi->services; 17 | } 18 | 19 | /** 20 | * @test 21 | */ 22 | public function get_services(): void 23 | { 24 | $response = $this->ocServices->getServiceJSON( 25 | 'org.opencastproject.ingest' 26 | ); 27 | $this->assertSame(200, $response['code'], 'Failure to get services list'); 28 | } 29 | 30 | /** 31 | * @test 32 | */ 33 | public function get_all_services(): void 34 | { 35 | $response = $this->ocServices->getServiceJSON(); 36 | $this->assertSame(200, $response['code'], 'Failure to get services list'); 37 | } 38 | } 39 | ?> 40 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Unit/OcStatisticsApiTest.php: -------------------------------------------------------------------------------- 1 | ocStatisticsApi = $ocRestApi->statisticsApi; 17 | } 18 | 19 | /** 20 | * @test 21 | * @dataProvider \Tests\DataProvider\StatisticsDataProvider::getAllCases() 22 | */ 23 | public function get_all_providers($filter, $withparameters): void 24 | { 25 | $response = $this->ocStatisticsApi->getAllProviders($filter, $withparameters); 26 | 27 | $this->assertSame(200, $response['code'], 'Failure to get providers list'); 28 | } 29 | 30 | /** 31 | * @test 32 | * @dataProvider \Tests\DataProvider\StatisticsDataProvider::getProviderId() 33 | */ 34 | public function get_provider($identifier): void 35 | { 36 | $response = $this->ocStatisticsApi->getProvider($identifier); 37 | 38 | $this->assertContains($response['code'], [200, 404], 'Failure to get provider'); 39 | } 40 | 41 | /** 42 | * @test 43 | * @dataProvider \Tests\DataProvider\StatisticsDataProvider::getStatisticalData() 44 | */ 45 | public function get_statistical_data($data): void 46 | { 47 | $this->markTestSkipped('currently skipped as the resources are not completed'); 48 | $response = $this->ocStatisticsApi->getStatisticalData($data); 49 | 50 | $this->assertContains($response['code'], [200, 404], 'Failure to get statistical data'); 51 | 52 | } 53 | 54 | /** 55 | * currently disabled as the resources are not completed 56 | * @test 57 | * @dataProvider \Tests\DataProvider\StatisticsDataProvider::getStatisticalDataCVS() 58 | */ 59 | public function get_statistical_data_cvs($data, $filter, $limit, $offset): void 60 | { 61 | $this->markTestSkipped('currently skipped as the resources are not completed'); 62 | $response = $this->ocStatisticsApi->getStatisticalDataCSV($data, $filter, $limit, $offset); 63 | 64 | $this->assertContains($response['code'], [200, 404], 'Failure to get statistical data cvs'); 65 | } 66 | } 67 | ?> 68 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/Unit/OcSysinfoTest.php: -------------------------------------------------------------------------------- 1 | ocSysinfo = $ocRestApi->sysinfo; 17 | } 18 | 19 | /** 20 | * @test 21 | */ 22 | public function get_version(): void 23 | { 24 | $responseAll = $this->ocSysinfo->getVersion(); 25 | $this->assertSame(200, $responseAll['code'], 'Failure to get version bundle'); 26 | 27 | $responseOpencast = $this->ocSysinfo->getVersion('opencast'); 28 | $this->assertSame(200, $responseOpencast['code'], 'Failure to get version bundle with opencast prefix'); 29 | } 30 | } 31 | ?> 32 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/UnitMock/OcAgentsApiTestMock.php: -------------------------------------------------------------------------------- 1 | markTestIncomplete('No mock responses for agents api could be found!'); 19 | } 20 | 21 | $mockHandler = OcMockHanlder::getHandlerStackWithPath($mockResponse); 22 | $config = \Tests\DataProvider\SetupDataProvider::getConfig(); 23 | $config['handler'] = $mockHandler; 24 | $ocRestApi = new Opencast($config, [], false); 25 | 26 | $this->ocAgentsApi = $ocRestApi->agentsApi; 27 | } 28 | 29 | /** 30 | * @test 31 | */ 32 | public function get_agents(): void 33 | { 34 | $responseAll = $this->ocAgentsApi->getAll(4, 0); 35 | $this->assertSame(200, $responseAll['code'], 'failure to get agent list'); 36 | $agents = $responseAll['body']; 37 | if (!empty($agents)) { 38 | $agent = $agents[array_rand($agents)]; 39 | $responseOne = $this->ocAgentsApi->get($agent->agent_id); 40 | $this->assertSame(200, $responseOne['code'], 'failure to get agent'); 41 | } else { 42 | $this->markTestIncomplete('No agents to complete the test!'); 43 | } 44 | } 45 | } 46 | ?> 47 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/UnitMock/OcSearchTestMock.php: -------------------------------------------------------------------------------- 1 | markTestIncomplete('No mock responses for search could be found!'); 18 | } 19 | $mockHandler = OcMockHanlder::getHandlerStackWithPath($mockResponse); 20 | $config = \Tests\DataProvider\SetupDataProvider::getConfig(); 21 | $config['handler'] = $mockHandler; 22 | $ocRestApi = new Opencast($config, [], false); 23 | $this->ocSearch = $ocRestApi->search; 24 | } 25 | 26 | /** 27 | * @test 28 | */ 29 | public function get_eposides(): void 30 | { 31 | $params = ['sid' => '8010876e-1dce-4d38-ab8d-24b956e3d8b7']; 32 | $response = $this->ocSearch->getEpisodes($params); 33 | $this->assertSame(200, $response['code'], 'Failure to search episode'); 34 | } 35 | 36 | /** 37 | * @test 38 | */ 39 | public function get_lucenes(): void 40 | { 41 | $params = ['series' => true]; 42 | $response = $this->ocSearch->getLucene($params); 43 | $this->assertContains($response['code'], [200, 410], 'Failure to create an event'); 44 | } 45 | 46 | /** 47 | * @test 48 | */ 49 | public function get_series(): void 50 | { 51 | $params = ['episodes' => true]; 52 | $response = $this->ocSearch->getSeries($params); 53 | $this->assertSame(200, $response['code'], 'Failure to search series'); 54 | } 55 | } 56 | ?> 57 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/UnitMock/OcSecurityApiTestMock.php: -------------------------------------------------------------------------------- 1 | markTestIncomplete('No mock responses for security could be found!'); 18 | } 19 | $mockHandler = OcMockHanlder::getHandlerStackWithPath($mockResponse); 20 | $config = \Tests\DataProvider\SetupDataProvider::getConfig(); 21 | $config['handler'] = $mockHandler; 22 | $ocRestApi = new Opencast($config, [], false); 23 | $this->ocSecurityApi = $ocRestApi->securityApi; 24 | } 25 | 26 | /** 27 | * @test 28 | */ 29 | public function sign(): void 30 | { 31 | $url = 'https://stable.opencast.org/'; 32 | $validUntil = '2022-12-29T23:59:59Z'; 33 | $response = $this->ocSecurityApi->sign($url, $validUntil); 34 | $this->assertSame(200, $response['code'], 'Failure to sign in security api'); 35 | } 36 | } 37 | ?> 38 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/UnitMock/OcServicesTestMock.php: -------------------------------------------------------------------------------- 1 | markTestIncomplete('No mock responses for services could be found!'); 18 | } 19 | $mockHandler = OcMockHanlder::getHandlerStackWithPath($mockResponse); 20 | $config = \Tests\DataProvider\SetupDataProvider::getConfig(); 21 | $config['handler'] = $mockHandler; 22 | $ocRestApi = new Opencast($config, [], false); 23 | $this->ocServices = $ocRestApi->services; 24 | } 25 | 26 | /** 27 | * @test 28 | */ 29 | public function get_services(): void 30 | { 31 | $response = $this->ocServices->getServiceJSON( 32 | 'org.opencastproject.ingest' 33 | ); 34 | $this->assertSame(200, $response['code'], 'Failure to get services list'); 35 | } 36 | 37 | /** 38 | * @test 39 | */ 40 | public function get_all_services(): void 41 | { 42 | $response = $this->ocServices->getServiceJSON(); 43 | $this->assertSame(200, $response['code'], 'Failure to get services list'); 44 | } 45 | } 46 | ?> 47 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/UnitMock/OcStatisticsApiTestMock.php: -------------------------------------------------------------------------------- 1 | markTestIncomplete('No mock responses for statistics api could be found!'); 18 | } 19 | $mockHandler = OcMockHanlder::getHandlerStackWithPath($mockResponse); 20 | $config = \Tests\DataProvider\SetupDataProvider::getConfig(); 21 | $config['handler'] = $mockHandler; 22 | $ocRestApi = new Opencast($config, [], false); 23 | $this->ocStatisticsApi = $ocRestApi->statisticsApi; 24 | } 25 | 26 | /** 27 | * @test 28 | */ 29 | public function get_all_providers(): void 30 | { 31 | $response = $this->ocStatisticsApi->getAllProviders(); 32 | $this->assertSame(200, $response['code'], 'Failure to get providers list'); 33 | } 34 | 35 | /** 36 | * @test 37 | */ 38 | public function get_provider(): void 39 | { 40 | $response = $this->ocStatisticsApi->getProvider('a-timeseries-provider'); 41 | 42 | $this->assertContains($response['code'], [200, 404], 'Failure to get provider'); 43 | } 44 | } 45 | ?> 46 | -------------------------------------------------------------------------------- /vendor/elan-ev/opencast-api/tests/UnitMock/OcSysinfoTestMock.php: -------------------------------------------------------------------------------- 1 | markTestIncomplete('No mock responses for sysinfo could be found!'); 18 | } 19 | $mockHandler = OcMockHanlder::getHandlerStackWithPath($mockResponse); 20 | $config = \Tests\DataProvider\SetupDataProvider::getConfig(); 21 | $config['handler'] = $mockHandler; 22 | $ocRestApi = new Opencast($config, [], false); 23 | $this->ocSysinfo = $ocRestApi->sysinfo; 24 | } 25 | 26 | /** 27 | * @test 28 | */ 29 | public function get_version(): void 30 | { 31 | $responseAll = $this->ocSysinfo->getVersion(); 32 | $this->assertSame(200, $responseAll['code'], 'Failure to get version bundle'); 33 | 34 | $responseOpencast = $this->ocSysinfo->getVersion('opencast'); 35 | $this->assertSame(200, $responseOpencast['code'], 'Failure to get version bundle with opencast prefix'); 36 | } 37 | } 38 | ?> 39 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011 Michael Dowling 4 | Copyright (c) 2012 Jeremy Lindblom 5 | Copyright (c) 2014 Graham Campbell 6 | Copyright (c) 2015 Márk Sági-Kazár 7 | Copyright (c) 2015 Tobias Schultze 8 | Copyright (c) 2016 Tobias Nyholm 9 | Copyright (c) 2016 George Mponos 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in 19 | all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | THE SOFTWARE. 28 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/BodySummarizer.php: -------------------------------------------------------------------------------- 1 | truncateAt = $truncateAt; 17 | } 18 | 19 | /** 20 | * Returns a summarized message body. 21 | */ 22 | public function summarize(MessageInterface $message): ?string 23 | { 24 | return $this->truncateAt === null 25 | ? \GuzzleHttp\Psr7\Message::bodySummary($message) 26 | : \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | interface CookieJarInterface extends \Countable, \IteratorAggregate 20 | { 21 | /** 22 | * Create a request with added cookie headers. 23 | * 24 | * If no matching cookies are found in the cookie jar, then no Cookie 25 | * header is added to the request and the same request is returned. 26 | * 27 | * @param RequestInterface $request Request object to modify. 28 | * 29 | * @return RequestInterface returns the modified request. 30 | */ 31 | public function withCookieHeader(RequestInterface $request): RequestInterface; 32 | 33 | /** 34 | * Extract cookies from an HTTP response and store them in the CookieJar. 35 | * 36 | * @param RequestInterface $request Request that was sent 37 | * @param ResponseInterface $response Response that was received 38 | */ 39 | public function extractCookies(RequestInterface $request, ResponseInterface $response): void; 40 | 41 | /** 42 | * Sets a cookie in the cookie jar. 43 | * 44 | * @param SetCookie $cookie Cookie to set. 45 | * 46 | * @return bool Returns true on success or false on failure 47 | */ 48 | public function setCookie(SetCookie $cookie): bool; 49 | 50 | /** 51 | * Remove cookies currently held in the cookie jar. 52 | * 53 | * Invoking this method without arguments will empty the whole cookie jar. 54 | * If given a $domain argument only cookies belonging to that domain will 55 | * be removed. If given a $domain and $path argument, cookies belonging to 56 | * the specified path within that domain are removed. If given all three 57 | * arguments, then the cookie with the specified name, path and domain is 58 | * removed. 59 | * 60 | * @param string|null $domain Clears cookies matching a domain 61 | * @param string|null $path Clears cookies matching a domain and path 62 | * @param string|null $name Clears cookies matching a domain, path, and name 63 | */ 64 | public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void; 65 | 66 | /** 67 | * Discard all sessions cookies. 68 | * 69 | * Removes cookies that don't have an expire field or a have a discard 70 | * field set to true. To be called when the user agent shuts down according 71 | * to RFC 2965. 72 | */ 73 | public function clearSessionCookies(): void; 74 | 75 | /** 76 | * Converts the cookie jar to an array. 77 | */ 78 | public function toArray(): array; 79 | } 80 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php: -------------------------------------------------------------------------------- 1 | sessionKey = $sessionKey; 32 | $this->storeSessionCookies = $storeSessionCookies; 33 | $this->load(); 34 | } 35 | 36 | /** 37 | * Saves cookies to session when shutting down 38 | */ 39 | public function __destruct() 40 | { 41 | $this->save(); 42 | } 43 | 44 | /** 45 | * Save cookies to the client session 46 | */ 47 | public function save(): void 48 | { 49 | $json = []; 50 | /** @var SetCookie $cookie */ 51 | foreach ($this as $cookie) { 52 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { 53 | $json[] = $cookie->toArray(); 54 | } 55 | } 56 | 57 | $_SESSION[$this->sessionKey] = \json_encode($json); 58 | } 59 | 60 | /** 61 | * Load the contents of the client session into the data array 62 | */ 63 | protected function load(): void 64 | { 65 | if (!isset($_SESSION[$this->sessionKey])) { 66 | return; 67 | } 68 | $data = \json_decode($_SESSION[$this->sessionKey], true); 69 | if (\is_array($data)) { 70 | foreach ($data as $cookie) { 71 | $this->setCookie(new SetCookie($cookie)); 72 | } 73 | } elseif (\strlen($data)) { 74 | throw new \RuntimeException("Invalid cookie data"); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php: -------------------------------------------------------------------------------- 1 | request = $request; 33 | $this->handlerContext = $handlerContext; 34 | } 35 | 36 | /** 37 | * Get the request that caused the exception 38 | */ 39 | public function getRequest(): RequestInterface 40 | { 41 | return $this->request; 42 | } 43 | 44 | /** 45 | * Get contextual information about the error from the underlying handler. 46 | * 47 | * The contents of this array will vary depending on which handler you are 48 | * using. It may also be just an empty array. Relying on this data will 49 | * couple you to a specific handler, but can give more debug information 50 | * when needed. 51 | */ 52 | public function getHandlerContext(): array 53 | { 54 | return $this->handlerContext; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php: -------------------------------------------------------------------------------- 1 | factory = $options['handle_factory'] 34 | ?? new CurlFactory(3); 35 | } 36 | 37 | public function __invoke(RequestInterface $request, array $options): PromiseInterface 38 | { 39 | if (isset($options['delay'])) { 40 | \usleep($options['delay'] * 1000); 41 | } 42 | 43 | $easy = $this->factory->create($request, $options); 44 | \curl_exec($easy->handle); 45 | $easy->errno = \curl_errno($easy->handle); 46 | 47 | return CurlFactory::finish($this, $easy, $this->factory); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php: -------------------------------------------------------------------------------- 1 | 4 | Copyright (c) 2015 Graham Campbell 5 | Copyright (c) 2017 Tobias Schultze 6 | Copyright (c) 2020 Tobias Nyholm 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/promises", 3 | "description": "Guzzle promises library", 4 | "keywords": ["promise"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Graham Campbell", 9 | "email": "hello@gjcampbell.co.uk", 10 | "homepage": "https://github.com/GrahamCampbell" 11 | }, 12 | { 13 | "name": "Michael Dowling", 14 | "email": "mtdowling@gmail.com", 15 | "homepage": "https://github.com/mtdowling" 16 | }, 17 | { 18 | "name": "Tobias Nyholm", 19 | "email": "tobias.nyholm@gmail.com", 20 | "homepage": "https://github.com/Nyholm" 21 | }, 22 | { 23 | "name": "Tobias Schultze", 24 | "email": "webmaster@tubo-world.de", 25 | "homepage": "https://github.com/Tobion" 26 | } 27 | ], 28 | "require": { 29 | "php": ">=5.5" 30 | }, 31 | "require-dev": { 32 | "symfony/phpunit-bridge": "^4.4 || ^5.1" 33 | }, 34 | "autoload": { 35 | "psr-4": { 36 | "GuzzleHttp\\Promise\\": "src/" 37 | }, 38 | "files": ["src/functions_include.php"] 39 | }, 40 | "autoload-dev": { 41 | "psr-4": { 42 | "GuzzleHttp\\Promise\\Tests\\": "tests/" 43 | } 44 | }, 45 | "scripts": { 46 | "test": "vendor/bin/simple-phpunit", 47 | "test-ci": "vendor/bin/simple-phpunit --coverage-text" 48 | }, 49 | "config": { 50 | "preferred-install": "dist", 51 | "sort-packages": true 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/AggregateException.php: -------------------------------------------------------------------------------- 1 | then([$promise, 'resolve'], [$promise, 'reject']); 26 | return $promise; 27 | } 28 | 29 | return new FulfilledPromise($value); 30 | } 31 | 32 | /** 33 | * Creates a rejected promise for a reason if the reason is not a promise. 34 | * If the provided reason is a promise, then it is returned as-is. 35 | * 36 | * @param mixed $reason Promise or reason. 37 | * 38 | * @return PromiseInterface 39 | */ 40 | public static function rejectionFor($reason) 41 | { 42 | if ($reason instanceof PromiseInterface) { 43 | return $reason; 44 | } 45 | 46 | return new RejectedPromise($reason); 47 | } 48 | 49 | /** 50 | * Create an exception for a rejected promise value. 51 | * 52 | * @param mixed $reason 53 | * 54 | * @return \Exception|\Throwable 55 | */ 56 | public static function exceptionFor($reason) 57 | { 58 | if ($reason instanceof \Exception || $reason instanceof \Throwable) { 59 | return $reason; 60 | } 61 | 62 | return new RejectionException($reason); 63 | } 64 | 65 | /** 66 | * Returns an iterator for the given value. 67 | * 68 | * @param mixed $value 69 | * 70 | * @return \Iterator 71 | */ 72 | public static function iterFor($value) 73 | { 74 | if ($value instanceof \Iterator) { 75 | return $value; 76 | } 77 | 78 | if (is_array($value)) { 79 | return new \ArrayIterator($value); 80 | } 81 | 82 | return new \ArrayIterator([$value]); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/FulfilledPromise.php: -------------------------------------------------------------------------------- 1 | value = $value; 24 | } 25 | 26 | public function then( 27 | callable $onFulfilled = null, 28 | callable $onRejected = null 29 | ) { 30 | // Return itself if there is no onFulfilled function. 31 | if (!$onFulfilled) { 32 | return $this; 33 | } 34 | 35 | $queue = Utils::queue(); 36 | $p = new Promise([$queue, 'run']); 37 | $value = $this->value; 38 | $queue->add(static function () use ($p, $value, $onFulfilled) { 39 | if (Is::pending($p)) { 40 | try { 41 | $p->resolve($onFulfilled($value)); 42 | } catch (\Throwable $e) { 43 | $p->reject($e); 44 | } catch (\Exception $e) { 45 | $p->reject($e); 46 | } 47 | } 48 | }); 49 | 50 | return $p; 51 | } 52 | 53 | public function otherwise(callable $onRejected) 54 | { 55 | return $this->then(null, $onRejected); 56 | } 57 | 58 | public function wait($unwrap = true, $defaultDelivery = null) 59 | { 60 | return $unwrap ? $this->value : null; 61 | } 62 | 63 | public function getState() 64 | { 65 | return self::FULFILLED; 66 | } 67 | 68 | public function resolve($value) 69 | { 70 | if ($value !== $this->value) { 71 | throw new \LogicException("Cannot resolve a fulfilled promise"); 72 | } 73 | } 74 | 75 | public function reject($reason) 76 | { 77 | throw new \LogicException("Cannot reject a fulfilled promise"); 78 | } 79 | 80 | public function cancel() 81 | { 82 | // pass 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/Is.php: -------------------------------------------------------------------------------- 1 | getState() === PromiseInterface::PENDING; 15 | } 16 | 17 | /** 18 | * Returns true if a promise is fulfilled or rejected. 19 | * 20 | * @return bool 21 | */ 22 | public static function settled(PromiseInterface $promise) 23 | { 24 | return $promise->getState() !== PromiseInterface::PENDING; 25 | } 26 | 27 | /** 28 | * Returns true if a promise is fulfilled. 29 | * 30 | * @return bool 31 | */ 32 | public static function fulfilled(PromiseInterface $promise) 33 | { 34 | return $promise->getState() === PromiseInterface::FULFILLED; 35 | } 36 | 37 | /** 38 | * Returns true if a promise is rejected. 39 | * 40 | * @return bool 41 | */ 42 | public static function rejected(PromiseInterface $promise) 43 | { 44 | return $promise->getState() === PromiseInterface::REJECTED; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/PromisorInterface.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 24 | } 25 | 26 | public function then( 27 | callable $onFulfilled = null, 28 | callable $onRejected = null 29 | ) { 30 | // If there's no onRejected callback then just return self. 31 | if (!$onRejected) { 32 | return $this; 33 | } 34 | 35 | $queue = Utils::queue(); 36 | $reason = $this->reason; 37 | $p = new Promise([$queue, 'run']); 38 | $queue->add(static function () use ($p, $reason, $onRejected) { 39 | if (Is::pending($p)) { 40 | try { 41 | // Return a resolved promise if onRejected does not throw. 42 | $p->resolve($onRejected($reason)); 43 | } catch (\Throwable $e) { 44 | // onRejected threw, so return a rejected promise. 45 | $p->reject($e); 46 | } catch (\Exception $e) { 47 | // onRejected threw, so return a rejected promise. 48 | $p->reject($e); 49 | } 50 | } 51 | }); 52 | 53 | return $p; 54 | } 55 | 56 | public function otherwise(callable $onRejected) 57 | { 58 | return $this->then(null, $onRejected); 59 | } 60 | 61 | public function wait($unwrap = true, $defaultDelivery = null) 62 | { 63 | if ($unwrap) { 64 | throw Create::exceptionFor($this->reason); 65 | } 66 | 67 | return null; 68 | } 69 | 70 | public function getState() 71 | { 72 | return self::REJECTED; 73 | } 74 | 75 | public function resolve($value) 76 | { 77 | throw new \LogicException("Cannot resolve a rejected promise"); 78 | } 79 | 80 | public function reject($reason) 81 | { 82 | if ($reason !== $this->reason) { 83 | throw new \LogicException("Cannot reject a rejected promise"); 84 | } 85 | } 86 | 87 | public function cancel() 88 | { 89 | // pass 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/RejectionException.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 22 | 23 | $message = 'The promise was rejected'; 24 | 25 | if ($description) { 26 | $message .= ' with reason: ' . $description; 27 | } elseif (is_string($reason) 28 | || (is_object($reason) && method_exists($reason, '__toString')) 29 | ) { 30 | $message .= ' with reason: ' . $this->reason; 31 | } elseif ($reason instanceof \JsonSerializable) { 32 | $message .= ' with reason: ' 33 | . json_encode($this->reason, JSON_PRETTY_PRINT); 34 | } 35 | 36 | parent::__construct($message); 37 | } 38 | 39 | /** 40 | * Returns the rejection reason. 41 | * 42 | * @return mixed 43 | */ 44 | public function getReason() 45 | { 46 | return $this->reason; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/TaskQueue.php: -------------------------------------------------------------------------------- 1 | run(); 13 | */ 14 | class TaskQueue implements TaskQueueInterface 15 | { 16 | private $enableShutdown = true; 17 | private $queue = []; 18 | 19 | public function __construct($withShutdown = true) 20 | { 21 | if ($withShutdown) { 22 | register_shutdown_function(function () { 23 | if ($this->enableShutdown) { 24 | // Only run the tasks if an E_ERROR didn't occur. 25 | $err = error_get_last(); 26 | if (!$err || ($err['type'] ^ E_ERROR)) { 27 | $this->run(); 28 | } 29 | } 30 | }); 31 | } 32 | } 33 | 34 | public function isEmpty() 35 | { 36 | return !$this->queue; 37 | } 38 | 39 | public function add(callable $task) 40 | { 41 | $this->queue[] = $task; 42 | } 43 | 44 | public function run() 45 | { 46 | while ($task = array_shift($this->queue)) { 47 | /** @var callable $task */ 48 | $task(); 49 | } 50 | } 51 | 52 | /** 53 | * The task queue will be run and exhausted by default when the process 54 | * exits IFF the exit is not the result of a PHP E_ERROR error. 55 | * 56 | * You can disable running the automatic shutdown of the queue by calling 57 | * this function. If you disable the task queue shutdown process, then you 58 | * MUST either run the task queue (as a result of running your event loop 59 | * or manually using the run() method) or wait on each outstanding promise. 60 | * 61 | * Note: This shutdown will occur before any destructors are triggered. 62 | */ 63 | public function disableShutdown() 64 | { 65 | $this->enableShutdown = false; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/TaskQueueInterface.php: -------------------------------------------------------------------------------- 1 | 4 | Copyright (c) 2015 Márk Sági-Kazár 5 | Copyright (c) 2015 Graham Campbell 6 | Copyright (c) 2016 Tobias Schultze 7 | Copyright (c) 2016 George Mponos 8 | Copyright (c) 2018 Tobias Nyholm 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/psr7", 3 | "description": "PSR-7 message implementation that also provides common utility methods", 4 | "keywords": [ 5 | "request", 6 | "response", 7 | "message", 8 | "stream", 9 | "http", 10 | "uri", 11 | "url", 12 | "psr-7" 13 | ], 14 | "license": "MIT", 15 | "authors": [ 16 | { 17 | "name": "Graham Campbell", 18 | "email": "hello@gjcampbell.co.uk", 19 | "homepage": "https://github.com/GrahamCampbell" 20 | }, 21 | { 22 | "name": "Michael Dowling", 23 | "email": "mtdowling@gmail.com", 24 | "homepage": "https://github.com/mtdowling" 25 | }, 26 | { 27 | "name": "George Mponos", 28 | "email": "gmponos@gmail.com", 29 | "homepage": "https://github.com/gmponos" 30 | }, 31 | { 32 | "name": "Tobias Nyholm", 33 | "email": "tobias.nyholm@gmail.com", 34 | "homepage": "https://github.com/Nyholm" 35 | }, 36 | { 37 | "name": "Márk Sági-Kazár", 38 | "email": "mark.sagikazar@gmail.com", 39 | "homepage": "https://github.com/sagikazarmark" 40 | }, 41 | { 42 | "name": "Tobias Schultze", 43 | "email": "webmaster@tubo-world.de", 44 | "homepage": "https://github.com/Tobion" 45 | }, 46 | { 47 | "name": "Márk Sági-Kazár", 48 | "email": "mark.sagikazar@gmail.com", 49 | "homepage": "https://sagikazarmark.hu" 50 | } 51 | ], 52 | "require": { 53 | "php": "^7.2.5 || ^8.0", 54 | "psr/http-factory": "^1.0", 55 | "psr/http-message": "^1.1 || ^2.0", 56 | "ralouphie/getallheaders": "^3.0" 57 | }, 58 | "provide": { 59 | "psr/http-factory-implementation": "1.0", 60 | "psr/http-message-implementation": "1.0" 61 | }, 62 | "require-dev": { 63 | "bamarni/composer-bin-plugin": "^1.8.1", 64 | "http-interop/http-factory-tests": "^0.9", 65 | "phpunit/phpunit": "^8.5.29 || ^9.5.23" 66 | }, 67 | "suggest": { 68 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 69 | }, 70 | "autoload": { 71 | "psr-4": { 72 | "GuzzleHttp\\Psr7\\": "src/" 73 | } 74 | }, 75 | "autoload-dev": { 76 | "psr-4": { 77 | "GuzzleHttp\\Tests\\Psr7\\": "tests/" 78 | } 79 | }, 80 | "extra": { 81 | "bamarni-bin": { 82 | "bin-links": true, 83 | "forward-command": false 84 | } 85 | }, 86 | "config": { 87 | "allow-plugins": { 88 | "bamarni/composer-bin-plugin": true 89 | }, 90 | "preferred-install": "dist", 91 | "sort-packages": true 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/DroppingStream.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 30 | $this->maxLength = $maxLength; 31 | } 32 | 33 | public function write($string): int 34 | { 35 | $diff = $this->maxLength - $this->stream->getSize(); 36 | 37 | // Begin returning 0 when the underlying stream is too large. 38 | if ($diff <= 0) { 39 | return 0; 40 | } 41 | 42 | // Write the stream or a subset of the stream if needed. 43 | if (strlen($string) < $diff) { 44 | return $this->stream->write($string); 45 | } 46 | 47 | return $this->stream->write(substr($string, 0, $diff)); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php: -------------------------------------------------------------------------------- 1 | 15 + 32]); 35 | $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/LazyOpenStream.php: -------------------------------------------------------------------------------- 1 | filename = $filename; 35 | $this->mode = $mode; 36 | 37 | // unsetting the property forces the first access to go through 38 | // __get(). 39 | unset($this->stream); 40 | } 41 | 42 | /** 43 | * Creates the underlying stream lazily when required. 44 | */ 45 | protected function createStream(): StreamInterface 46 | { 47 | return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/NoSeekStream.php: -------------------------------------------------------------------------------- 1 | @,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; 22 | public const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/UriComparator.php: -------------------------------------------------------------------------------- 1 | getHost(), $modified->getHost()) !== 0) { 23 | return true; 24 | } 25 | 26 | if ($original->getScheme() !== $modified->getScheme()) { 27 | return true; 28 | } 29 | 30 | if (self::computePort($original) !== self::computePort($modified)) { 31 | return true; 32 | } 33 | 34 | return false; 35 | } 36 | 37 | private static function computePort(UriInterface $uri): int 38 | { 39 | $port = $uri->getPort(); 40 | 41 | if (null !== $port) { 42 | return $port; 43 | } 44 | 45 | return 'https' === $uri->getScheme() ? 443 : 80; 46 | } 47 | 48 | private function __construct() 49 | { 50 | // cannot be instantiated 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/psr/http-client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file, in reverse chronological order by release. 4 | 5 | ## 1.0.3 6 | 7 | Add `source` link in composer.json. No code changes. 8 | 9 | ## 1.0.2 10 | 11 | Allow PSR-7 (psr/http-message) 2.0. No code changes. 12 | 13 | ## 1.0.1 14 | 15 | Allow installation with PHP 8. No code changes. 16 | 17 | ## 1.0.0 18 | 19 | First stable release. No changes since 0.3.0. 20 | 21 | ## 0.3.0 22 | 23 | Added Interface suffix on exceptions 24 | 25 | ## 0.2.0 26 | 27 | All exceptions are in `Psr\Http\Client` namespace 28 | 29 | ## 0.1.0 30 | 31 | First release 32 | -------------------------------------------------------------------------------- /vendor/psr/http-client/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 PHP Framework Interoperability Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/psr/http-client/README.md: -------------------------------------------------------------------------------- 1 | HTTP Client 2 | =========== 3 | 4 | This repository holds all the common code related to [PSR-18 (HTTP Client)][psr-url]. 5 | 6 | Note that this is not a HTTP Client implementation of its own. It is merely abstractions that describe the components of a HTTP Client. 7 | 8 | The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. 9 | 10 | [psr-url]: https://www.php-fig.org/psr/psr-18 11 | [package-url]: https://packagist.org/packages/psr/http-client 12 | [implementation-url]: https://packagist.org/providers/psr/http-client-implementation 13 | -------------------------------------------------------------------------------- /vendor/psr/http-client/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "psr/http-client", 3 | "description": "Common interface for HTTP clients", 4 | "keywords": ["psr", "psr-18", "http", "http-client"], 5 | "homepage": "https://github.com/php-fig/http-client", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "PHP-FIG", 10 | "homepage": "https://www.php-fig.org/" 11 | } 12 | ], 13 | "support": { 14 | "source": "https://github.com/php-fig/http-client" 15 | }, 16 | "require": { 17 | "php": "^7.0 || ^8.0", 18 | "psr/http-message": "^1.0 || ^2.0" 19 | }, 20 | "autoload": { 21 | "psr-4": { 22 | "Psr\\Http\\Client\\": "src/" 23 | } 24 | }, 25 | "extra": { 26 | "branch-alias": { 27 | "dev-master": "1.0.x-dev" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/psr/http-client/src/ClientExceptionInterface.php: -------------------------------------------------------------------------------- 1 | =7.0.0", 23 | "psr/http-message": "^1.0 || ^2.0" 24 | }, 25 | "autoload": { 26 | "psr-4": { 27 | "Psr\\Http\\Message\\": "src/" 28 | } 29 | }, 30 | "extra": { 31 | "branch-alias": { 32 | "dev-master": "1.0.x-dev" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/psr/http-factory/src/RequestFactoryInterface.php: -------------------------------------------------------------------------------- 1 | = 5.3. 5 | 6 | [![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) 7 | [![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) 8 | [![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) 9 | [![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) 10 | [![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) 11 | 12 | 13 | This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). 14 | 15 | ## Install 16 | 17 | For PHP version **`>= 5.6`**: 18 | 19 | ``` 20 | composer require ralouphie/getallheaders 21 | ``` 22 | 23 | For PHP version **`< 5.6`**: 24 | 25 | ``` 26 | composer require ralouphie/getallheaders "^2" 27 | ``` 28 | -------------------------------------------------------------------------------- /vendor/ralouphie/getallheaders/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ralouphie/getallheaders", 3 | "description": "A polyfill for getallheaders.", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "Ralph Khattar", 8 | "email": "ralph.khattar@gmail.com" 9 | } 10 | ], 11 | "require": { 12 | "php": ">=5.6" 13 | }, 14 | "require-dev": { 15 | "phpunit/phpunit": "^5 || ^6.5", 16 | "php-coveralls/php-coveralls": "^2.1" 17 | }, 18 | "autoload": { 19 | "files": ["src/getallheaders.php"] 20 | }, 21 | "autoload-dev": { 22 | "psr-4": { 23 | "getallheaders\\Tests\\": "tests/" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/ralouphie/getallheaders/src/getallheaders.php: -------------------------------------------------------------------------------- 1 | 'Content-Type', 16 | 'CONTENT_LENGTH' => 'Content-Length', 17 | 'CONTENT_MD5' => 'Content-Md5', 18 | ); 19 | 20 | foreach ($_SERVER as $key => $value) { 21 | if (substr($key, 0, 5) === 'HTTP_') { 22 | $key = substr($key, 5); 23 | if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { 24 | $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); 25 | $headers[$key] = $value; 26 | } 27 | } elseif (isset($copy_server[$key])) { 28 | $headers[$copy_server[$key]] = $value; 29 | } 30 | } 31 | 32 | if (!isset($headers['Authorization'])) { 33 | if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { 34 | $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; 35 | } elseif (isset($_SERVER['PHP_AUTH_USER'])) { 36 | $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; 37 | $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); 38 | } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { 39 | $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; 40 | } 41 | } 42 | 43 | return $headers; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /vendor/symfony/deprecation-contracts/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | The changelog is maintained for all Symfony contracts at the following URL: 5 | https://github.com/symfony/contracts/blob/main/CHANGELOG.md 6 | -------------------------------------------------------------------------------- /vendor/symfony/deprecation-contracts/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020-present Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/deprecation-contracts/README.md: -------------------------------------------------------------------------------- 1 | Symfony Deprecation Contracts 2 | ============================= 3 | 4 | A generic function and convention to trigger deprecation notices. 5 | 6 | This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. 7 | 8 | By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, 9 | the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. 10 | 11 | The function requires at least 3 arguments: 12 | - the name of the Composer package that is triggering the deprecation 13 | - the version of the package that introduced the deprecation 14 | - the message of the deprecation 15 | - more arguments can be provided: they will be inserted in the message using `printf()` formatting 16 | 17 | Example: 18 | ```php 19 | trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); 20 | ``` 21 | 22 | This will generate the following message: 23 | `Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` 24 | 25 | While not recommended, the deprecation notices can be completely ignored by declaring an empty 26 | `function trigger_deprecation() {}` in your application. 27 | -------------------------------------------------------------------------------- /vendor/symfony/deprecation-contracts/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/deprecation-contracts", 3 | "type": "library", 4 | "description": "A generic function and convention to trigger deprecation notices", 5 | "homepage": "https://symfony.com", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Nicolas Grekas", 10 | "email": "p@tchwork.com" 11 | }, 12 | { 13 | "name": "Symfony Community", 14 | "homepage": "https://symfony.com/contributors" 15 | } 16 | ], 17 | "require": { 18 | "php": ">=8.1" 19 | }, 20 | "autoload": { 21 | "files": [ 22 | "function.php" 23 | ] 24 | }, 25 | "minimum-stability": "dev", 26 | "extra": { 27 | "branch-alias": { 28 | "dev-main": "3.4-dev" 29 | }, 30 | "thanks": { 31 | "name": "symfony/contracts", 32 | "url": "https://github.com/symfony/contracts" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/symfony/deprecation-contracts/function.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (!function_exists('trigger_deprecation')) { 13 | /** 14 | * Triggers a silenced deprecation notice. 15 | * 16 | * @param string $package The name of the Composer package that is triggering the deprecation 17 | * @param string $version The version of the package that introduced the deprecation 18 | * @param string $message The message of the deprecation 19 | * @param mixed ...$args Values to insert in the message using printf() formatting 20 | * 21 | * @author Nicolas Grekas 22 | */ 23 | function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void 24 | { 25 | @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Plugin version and other meta-data are defined here. 19 | * 20 | * @package tool_opencast 21 | * @copyright 2024 Thomas Niedermaier 22 | * @copyright 2018 Tobias Reischmann 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 24 | */ 25 | 26 | defined('MOODLE_INTERNAL') || die(); 27 | 28 | $plugin->component = 'tool_opencast'; 29 | $plugin->release = 'v4.5-r4'; 30 | $plugin->version = 2024111103; 31 | $plugin->requires = 2024100700; // Requires Moodle 4.5+. 32 | $plugin->supported = [405, 405]; 33 | $plugin->maturity = MATURITY_STABLE; 34 | --------------------------------------------------------------------------------