mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 07:22:34 +00:00
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
65 lines
1.3 KiB
PHP
Executable File
65 lines
1.3 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\SiteTypes;
|
|
|
|
use App\Exceptions\SSHError;
|
|
use App\Models\Site;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class PHPBlank extends PHPSite
|
|
{
|
|
public static function id(): string
|
|
{
|
|
return 'php-blank';
|
|
}
|
|
|
|
public static function make(): self
|
|
{
|
|
return new self(new Site(['type' => self::id()]));
|
|
}
|
|
|
|
public function createRules(array $input): array
|
|
{
|
|
return [
|
|
'web_directory' => [
|
|
'nullable',
|
|
'string',
|
|
'max:255',
|
|
],
|
|
'php_version' => [
|
|
'required',
|
|
Rule::in($this->site->server->installedPHPVersions()),
|
|
],
|
|
];
|
|
}
|
|
|
|
public function createFields(array $input): array
|
|
{
|
|
return [
|
|
'web_directory' => $input['web_directory'] ?? '',
|
|
'php_version' => $input['php_version'] ?? '',
|
|
];
|
|
}
|
|
|
|
public function data(array $input): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* @throws SSHError
|
|
*/
|
|
public function install(): void
|
|
{
|
|
$this->isolate();
|
|
$this->site->webserver()->createVHost($this->site);
|
|
$this->progress(65);
|
|
$this->site->php()?->restart();
|
|
}
|
|
|
|
public function baseCommands(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|