19 declare(strict_types=1);
44 float $valid_for_at_least_minutes = 60.0,
48 throw new \RuntimeException(
'InlineSrcBuilder does not support signed URLs');
50 $sream_resolver = $revision->maybeStreamResolver();
51 if ($sream_resolver !==
null) {
52 $stream = $sream_resolver->getStream();
53 if ($sream_resolver->isInMemory()) {
57 $this->file_delivery->buildTokenURL(
73 throw new \RuntimeException(
'InlineSrcBuilder does not support signed URLs');
75 foreach ($flavour->getStreamResolvers() as $stream_resolver) {
76 $stream = $stream_resolver->getStream();
83 $mime_type = mime_content_type($stream->getMetadata()[
'uri']) ?:
'application/octet-stream';
84 $base64 = base64_encode((
string) $stream);
85 return "data:$mime_type;base64,$base64";
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRevisionURL(Revision $revision, bool $signed=true, float $valid_for_at_least_minutes=60.0, ?string $filename=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(private Services $file_delivery)
getFlavourURLs(Flavour $flavour, bool $signed=true)
buildDataURLFromStream(FileStream $stream)