mirror of
https://github.com/YGGverse/bdoku.git
synced 2026-03-31 17:55:36 +00:00
add media content support
This commit is contained in:
parent
998de4a899
commit
850c84b538
1 changed files with 27 additions and 4 deletions
|
|
@ -128,7 +128,7 @@ foreach ($filesystem->getList() as $path)
|
||||||
|
|
||||||
if ($uri = $filesystem->getPageUriByPath($path))
|
if ($uri = $filesystem->getPageUriByPath($path))
|
||||||
{
|
{
|
||||||
if ($data = $filesystem->getData($path))
|
if ($data = $filesystem->getDataByPath($path))
|
||||||
{
|
{
|
||||||
$gemini = $reader->toGemini(
|
$gemini = $reader->toGemini(
|
||||||
$data
|
$data
|
||||||
|
|
@ -401,7 +401,7 @@ $server->setHandler(
|
||||||
|
|
||||||
// Convert
|
// Convert
|
||||||
$gemini = $reader->toGemini(
|
$gemini = $reader->toGemini(
|
||||||
$filesystem->getData(
|
$filesystem->getDataByPath(
|
||||||
$path
|
$path
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -511,7 +511,7 @@ $server->setHandler(
|
||||||
{
|
{
|
||||||
$h1[] = $reader->getH1(
|
$h1[] = $reader->getH1(
|
||||||
$reader->toGemini(
|
$reader->toGemini(
|
||||||
$filesystem->getData(
|
$filesystem->getDataByPath(
|
||||||
$file
|
$file
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -523,7 +523,7 @@ $server->setHandler(
|
||||||
{
|
{
|
||||||
$h1[] = $reader->getH1(
|
$h1[] = $reader->getH1(
|
||||||
$reader->toGemini(
|
$reader->toGemini(
|
||||||
$filesystem->getData(
|
$filesystem->getDataByPath(
|
||||||
$file
|
$file
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -616,6 +616,29 @@ $server->setHandler(
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Media request
|
||||||
|
else if ($path = $filesystem->getMediaPathByUri($_uri))
|
||||||
|
{
|
||||||
|
if ($mime = $filesystem->getMimeByPath($path))
|
||||||
|
{
|
||||||
|
if ($data = $filesystem->getDataByPath($path))
|
||||||
|
{
|
||||||
|
// Set MIME
|
||||||
|
$response->setMeta(
|
||||||
|
$mime
|
||||||
|
);
|
||||||
|
|
||||||
|
// Append data
|
||||||
|
$response->setContent(
|
||||||
|
$data
|
||||||
|
);
|
||||||
|
|
||||||
|
// Response
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Route not found
|
// Route not found
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue