2019-09-05 20:33:27 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Repositories\Wings;
|
|
|
|
|
2019-12-09 21:05:39 -08:00
|
|
|
use GuzzleHttp\Exception\TransferException;
|
|
|
|
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
|
|
|
|
|
2019-09-05 20:33:27 -07:00
|
|
|
class DaemonConfigurationRepository extends DaemonRepository
|
|
|
|
{
|
2019-12-09 21:05:39 -08:00
|
|
|
/**
|
|
|
|
* Returns system information from the wings instance.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
|
|
|
|
*/
|
|
|
|
public function getSystemInformation(): array
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
$response = $this->getHttpClient()->get('/api/system');
|
|
|
|
} catch (TransferException $exception) {
|
|
|
|
throw new DaemonConnectionException($exception);
|
|
|
|
}
|
|
|
|
|
|
|
|
return json_decode($response->getBody()->__toString(), true);
|
|
|
|
}
|
2019-09-05 20:33:27 -07:00
|
|
|
}
|