2017-08-26 18:08:11 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Repositories\Daemon;
|
|
|
|
|
2018-01-05 18:27:47 -06:00
|
|
|
use Psr\Http\Message\ResponseInterface;
|
2017-08-26 18:08:11 -05:00
|
|
|
use Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface;
|
|
|
|
|
|
|
|
class CommandRepository extends BaseRepository implements CommandRepositoryInterface
|
|
|
|
{
|
|
|
|
/**
|
2018-01-05 18:27:47 -06:00
|
|
|
* Send a command to a server.
|
|
|
|
*
|
|
|
|
* @param string $command
|
|
|
|
* @return \Psr\Http\Message\ResponseInterface
|
2017-08-26 18:08:11 -05:00
|
|
|
*/
|
2018-01-05 18:27:47 -06:00
|
|
|
public function send(string $command): ResponseInterface
|
2017-08-26 18:08:11 -05:00
|
|
|
{
|
2017-09-30 21:00:24 -05:00
|
|
|
return $this->getHttpClient()->request('POST', 'server/command', [
|
2017-08-26 18:08:11 -05:00
|
|
|
'json' => [
|
|
|
|
'command' => $command,
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|