|
static | checkResponse (array $response, &$body, array $allowedStatus=[200, 204]) |
|
static | buildQuery (array $params, $encoding=PHP_QUERY_RFC3986) |
|
◆ __construct()
ilCmiXapiAbstractRequest::__construct |
( |
string |
$basicAuth | ) |
|
◆ buildQuery()
static ilCmiXapiAbstractRequest::buildQuery |
( |
array |
$params, |
|
|
|
$encoding = PHP_QUERY_RFC3986 |
|
) |
| |
|
static |
Definition at line 92 of file class.ilCmiXapiAbstractRequest.php.
Referenced by ilCmiXapiLaunchGUI\CMI5preLaunch(), and ilXapiStatementEvaluation\sendSatisfiedStatement().
98 if ($encoding ===
false) {
99 $encoder = fn ($str) => $str;
100 } elseif ($encoding === PHP_QUERY_RFC3986) {
101 $encoder =
'rawurlencode';
102 } elseif ($encoding === PHP_QUERY_RFC1738) {
103 $encoder =
'urlencode';
105 throw new \InvalidArgumentException(
'Invalid type');
109 foreach (
$params as $k => $v) {
114 $qs .=
'=' . $encoder($v);
118 foreach ($v as $vv) {
121 $qs .=
'=' . $encoder($vv);
127 return $qs ? (string) substr($qs, 0, -1) :
'';
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
◆ checkResponse()
static ilCmiXapiAbstractRequest::checkResponse |
( |
array |
$response, |
|
|
& |
$body, |
|
|
array |
$allowedStatus = [200 , |
|
|
204] |
|
|
) |
| |
|
static |
◆ sendRequest()
ilCmiXapiAbstractRequest::sendRequest |
( |
string |
$url | ) |
|
|
protected |
Definition at line 43 of file class.ilCmiXapiAbstractRequest.php.
References $client, Vendor\Package\$e, and ilObjCmiXapi\log().
Referenced by ilCmiXapiStatementsReportRequest\queryReport(), and ilCmiXapiHighscoreReportRequest\queryReport().
47 GuzzleHttp\RequestOptions::VERIFY =>
true,
48 GuzzleHttp\RequestOptions::CONNECT_TIMEOUT => 10,
49 GuzzleHttp\RequestOptions::HTTP_ERRORS =>
false 53 'Authorization' => $this->basicAuth,
54 'X-Experience-API-Version' =>
'1.0.3' 59 $promises[
'default'] =
$client->sendAsync($request, $req_opts);
60 $responses = GuzzleHttp\Promise\Utils::settle($promises)->wait();
61 self::checkResponse($responses[
'default'], $body);
65 throw new Exception(
"LRS Connection Problems", $e->getCode(),
$e);
◆ $basicAuth
string ilCmiXapiAbstractRequest::$basicAuth |
|
private |
◆ $plugin
bool ilCmiXapiAbstractRequest::$plugin = false |
|
static |
The documentation for this class was generated from the following file: