vito/app/ServerTypes/Regular.php
Saeed Vaziry 428140b931
refactoring (#116)
- refactoring architecture
- fix incomplete ssh logs
- code editor for scripts in the app
- remove Jobs and SSHCommands
2024-03-14 20:03:43 +01:00

41 lines
982 B
PHP
Executable File

<?php
namespace App\ServerTypes;
class Regular extends AbstractType
{
public function createRules(array $input): array
{
return [
'webserver' => [
'required',
'in:'.implode(',', config('core.webservers')),
],
'php' => [
'required',
'in:'.implode(',', config('core.php_versions')),
],
'database' => [
'required',
'in:'.implode(',', 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();
}
}