Add FileStorageConfiguration class for file storage settings

This commit is contained in:
netkas 2025-05-29 19:47:03 -04:00
parent 85e20d38d2
commit 3bbeb5c5f5
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -0,0 +1,41 @@
<?php
namespace FederationServer\Classes\Configuration;
class FileStorageConfiguration
{
private string $path;
private int $maxSize;
/**
* FileStorageConfiguration constructor.
*
* @param array $config Array with file storage configuration values.
*/
public function __construct(array $config)
{
$this->path = $config['path'] ?? '/var/www/uploads';
$this->maxSize = $config['max_size'] ?? 52428800;
}
/**
* Get the file storage path.
*
* @return string
*/
public function getPath(): string
{
return $this->path;
}
/**
* Get the maximum file size allowed for uploads.
*
* @return int
*/
public function getMaxSize(): int
{
return $this->maxSize;
}
}