74 lines
1.2 KiB
PHP
74 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Entity;
|
|
|
|
final class Station
|
|
{
|
|
public function __construct(public int $id, private string $radioTempDirectory)
|
|
{
|
|
}
|
|
|
|
public function getRadioTempDir(): string
|
|
{
|
|
return $this->radioTempDirectory;
|
|
}
|
|
}
|
|
|
|
final class StationMedia
|
|
{
|
|
public function __construct(
|
|
public int $storage_location_id,
|
|
public string $unique_id,
|
|
public int $mtime,
|
|
public string $path,
|
|
) {
|
|
}
|
|
}
|
|
|
|
namespace App\Flysystem;
|
|
|
|
use App\Entity\Station;
|
|
|
|
final class StationFilesystems
|
|
{
|
|
public function __construct(private object $filesystem)
|
|
{
|
|
}
|
|
|
|
public function getMediaFilesystem(Station $station): object
|
|
{
|
|
return $this->filesystem;
|
|
}
|
|
}
|
|
|
|
namespace App\Event\Nginx;
|
|
|
|
use App\Entity\Station;
|
|
|
|
final class WriteNginxConfiguration
|
|
{
|
|
/** @var list<string> */
|
|
private array $blocks = [];
|
|
|
|
public function __construct(private Station $station)
|
|
{
|
|
}
|
|
|
|
public function getStation(): Station
|
|
{
|
|
return $this->station;
|
|
}
|
|
|
|
public function appendBlock(string $block): void
|
|
{
|
|
$this->blocks[] = $block;
|
|
}
|
|
|
|
public function buildConfiguration(): string
|
|
{
|
|
return implode("\n", $this->blocks);
|
|
}
|
|
}
|