feat: add secure on-demand HLS playback plugin

This commit is contained in:
root
2026-09-04 20:23:10 +02:00
commit 6fae6a3a43
35 changed files with 2283 additions and 0 deletions
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace Plugin\AzuraCastOnDemandHls\Tests\Support;
use PHPUnit\Framework\TestCase;
abstract class TemporaryDirectoryTestCase extends TestCase
{
protected string $temporaryDirectory;
protected function setUp(): void
{
parent::setUp();
$this->temporaryDirectory = sys_get_temp_dir() . '/ondemand-hls-test-' . bin2hex(random_bytes(8));
mkdir($this->temporaryDirectory, 0700, true);
}
protected function tearDown(): void
{
$this->removeTree($this->temporaryDirectory);
parent::tearDown();
}
private function removeTree(string $path): void
{
if (is_link($path) || is_file($path)) {
@unlink($path);
return;
}
if (!is_dir($path)) {
return;
}
foreach (new \FilesystemIterator($path, \FilesystemIterator::SKIP_DOTS) as $item) {
$this->removeTree($item->getPathname());
}
@rmdir($path);
}
}