Files
pterodactyl-panel/app/Actions/Files/ReadFileContents.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

22 lines
586 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Actions\Files;
use Pterodactyl\Contracts\Files\ReadsFileContents;
use Pterodactyl\Facades\Daemon;
use Pterodactyl\Models\Server;
use Pterodactyl\Support\JsonValueGuard;
final readonly class ReadFileContents implements ReadsFileContents
{
public function read(Server $server, string $path, ?int $maxBytes = null): string
{
return Daemon::server($server)->files()->getContent(
$path,
$maxBytes ?? JsonValueGuard::nullableInteger(config('pterodactyl.files.max_edit_size'))
);
}
}