Add ability to switch between new and existing daemon

This commit is contained in:
Dane Everitt 2017-09-30 19:23:44 -05:00
parent 281337943f
commit 15d38ce823
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 466 additions and 5 deletions

View file

@ -0,0 +1,30 @@
<?php
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
*
* This software is licensed under the terms of the MIT license.
* https://opensource.org/licenses/MIT
*/
namespace Pterodactyl\Repositories\Wings;
use Webmozart\Assert\Assert;
use Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface;
class CommandRepository extends BaseRepository implements CommandRepositoryInterface
{
/**
* {@inheritdoc}
*/
public function send($command)
{
Assert::stringNotEmpty($command, 'First argument passed to send must be a non-empty string, received %s.');
return $this->getHttpClient()->request('POST', '/server/' . $this->getAccessServer() . '/command', [
'json' => [
'command' => $command,
],
]);
}
}