mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
First pass at XML exporter for services
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?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\Http\Controllers\Admin\Services\Options;
|
||||
|
||||
use Pterodactyl\Models\ServiceOption;
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Pterodactyl\Services\Services\Exporter\XMLExporterService;
|
||||
|
||||
class OptionShareController extends Controller
|
||||
{
|
||||
/**
|
||||
* @var \Pterodactyl\Services\Services\Exporter\XMLExporterService
|
||||
*/
|
||||
protected $exporterService;
|
||||
|
||||
/**
|
||||
* OptionShareController constructor.
|
||||
*
|
||||
* @param \Pterodactyl\Services\Services\Exporter\XMLExporterService $exporterService
|
||||
*/
|
||||
public function __construct(XMLExporterService $exporterService)
|
||||
{
|
||||
$this->exporterService = $exporterService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Pterodactyl\Models\ServiceOption $option
|
||||
* @return $this
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function export(ServiceOption $option)
|
||||
{
|
||||
return response($this->exporterService->handle($option), 200, [
|
||||
'Content-Type' => 'application/xml',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user