mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 02:11:36 +00:00
44 lines
986 B
PHP
Executable File
44 lines
986 B
PHP
Executable File
<?php
|
|
|
|
namespace App\ServerTypes;
|
|
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class Regular extends AbstractType
|
|
{
|
|
public function createRules(array $input): array
|
|
{
|
|
return [
|
|
'webserver' => [
|
|
'required',
|
|
Rule::in(config('core.webservers')),
|
|
|
|
],
|
|
'php' => [
|
|
'required',
|
|
Rule::in(config('core.php_versions')),
|
|
],
|
|
'database' => [
|
|
'required',
|
|
Rule::in(config('core.databases')),
|
|
],
|
|
];
|
|
}
|
|
|
|
public function data(array $input): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public function createServices(array $input): void
|
|
{
|
|
$this->server->services()->forceDelete();
|
|
$this->addWebserver($input['webserver']);
|
|
$this->addDatabase($input['database']);
|
|
$this->addPHP($input['php']);
|
|
$this->addSupervisor();
|
|
$this->addRedis();
|
|
$this->addUfw();
|
|
}
|
|
}
|