mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-23 01:22:30 +01:00
44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Pterodactyl\Services\Servers;
|
|
|
|
use Pterodactyl\Models\Server;
|
|
use Pterodactyl\Repositories\Wings\DaemonServerRepository;
|
|
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
|
|
|
|
class TransferService
|
|
{
|
|
/**
|
|
* @var \Pterodactyl\Contracts\Repository\ServerRepositoryInterface
|
|
*/
|
|
private $repository;
|
|
|
|
/**
|
|
* @var \Pterodactyl\Repositories\Wings\DaemonServerRepository
|
|
*/
|
|
private $daemonServerRepository;
|
|
|
|
/**
|
|
* TransferService constructor.
|
|
*/
|
|
public function __construct(
|
|
DaemonServerRepository $daemonServerRepository,
|
|
ServerRepositoryInterface $repository
|
|
) {
|
|
$this->repository = $repository;
|
|
$this->daemonServerRepository = $daemonServerRepository;
|
|
}
|
|
|
|
/**
|
|
* Requests an archive from the daemon.
|
|
*
|
|
* @param int|\Pterodactyl\Models\Server $server
|
|
*
|
|
* @throws \Throwable
|
|
*/
|
|
public function requestArchive(Server $server)
|
|
{
|
|
$this->daemonServerRepository->setServer($server)->requestArchive();
|
|
}
|
|
}
|