mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
22 lines
586 B
PHP
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'))
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|