This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/download/main.php

26 lines
555 B
PHP

<?php
declare(strict_types=1);
namespace Shimmie2;
require_once "events.php";
class Download extends Extension
{
public function get_priority(): int
{
// Set near the end to give everything else a chance to process
return 99;
}
public function onImageDownloading(ImageDownloadingEvent $event): void
{
global $page;
$page->set_mime($event->mime);
$page->set_mode(PageMode::FILE);
$page->set_file($event->path, $event->file_modified);
$event->stop_processing = true;
}
}