1. Go to this page and download the library: Download edu-sharing/auth-plugin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
edu-sharing / auth-plugin example snippets
use EduSharingApiClient\DefaultSignatureHandler;
class MySignatureHandler extends DefaultSignatureHandler
{
public function getAlgorithm(): string {
// Reuse a previously resolved algorithm from the session / global storage.
if (!empty($_SESSION['edusharing_signature_algorithm'])) {
return $_SESSION['edusharing_signature_algorithm'];
}
// Resolve via the About endpoint (with built-in fallback) and persist it.
$algorithm = parent::getAlgorithm();
$_SESSION['edusharing_signature_algorithm'] = $algorithm;
return $algorithm;
}
}
$base->registerCurlHandler(new class extends CurlHandler {
public function handleCurlRequest(string $url, array $curlOptions): CurlResult
{
return new CurlResult('', 0, []);
}
});