2021-01-07 16:32:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Controllers\Api\Application;
|
|
|
|
|
|
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
use Pterodactyl\Services\Helpers\SoftwareVersionService;
|
|
|
|
|
|
|
|
class VersionController extends ApplicationApiController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var \Pterodactyl\Services\Helpers\SoftwareVersionService
|
|
|
|
*/
|
|
|
|
private SoftwareVersionService $softwareVersionService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VersionController constructor.
|
|
|
|
*
|
|
|
|
* @param \Pterodactyl\Services\Helpers\SoftwareVersionService $softwareVersionService
|
|
|
|
*/
|
|
|
|
public function __construct(SoftwareVersionService $softwareVersionService)
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
$this->softwareVersionService = $softwareVersionService;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-01-07 17:21:09 +00:00
|
|
|
* Returns version information.
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Http\JsonResponse
|
2021-01-07 16:32:04 +00:00
|
|
|
*/
|
2021-01-07 17:21:09 +00:00
|
|
|
public function __invoke(): JsonResponse
|
2021-01-07 16:32:04 +00:00
|
|
|
{
|
|
|
|
return new JsonResponse($this->softwareVersionService->getVersionData());
|
|
|
|
}
|
|
|
|
}
|