mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 15:32:35 +00:00
Plugins base (#613)
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
This commit is contained in:
@ -2,34 +2,20 @@
|
||||
|
||||
namespace App\SiteTypes;
|
||||
|
||||
use App\DTOs\DynamicFieldDTO;
|
||||
use App\DTOs\DynamicFieldsCollectionDTO;
|
||||
use App\Enums\SiteFeature;
|
||||
use App\Exceptions\SSHError;
|
||||
use App\Models\Site;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class PHPMyAdmin extends PHPSite
|
||||
{
|
||||
public static function id(): string
|
||||
{
|
||||
return 'phpmyadmin';
|
||||
}
|
||||
|
||||
public static function make(): self
|
||||
{
|
||||
return new self(new Site(['type' => \App\Enums\SiteType::PHPMYADMIN]));
|
||||
}
|
||||
|
||||
public function supportedFeatures(): array
|
||||
{
|
||||
return [
|
||||
SiteFeature::SSL,
|
||||
];
|
||||
}
|
||||
|
||||
public function fields(): DynamicFieldsCollectionDTO
|
||||
{
|
||||
return new DynamicFieldsCollectionDTO([
|
||||
DynamicFieldDTO::make('php_version')
|
||||
->component()
|
||||
->label('PHP Version'),
|
||||
]);
|
||||
return new self(new Site(['type' => self::id()]));
|
||||
}
|
||||
|
||||
public function createRules(array $input): array
|
||||
@ -65,7 +51,14 @@ public function install(): void
|
||||
$this->isolate();
|
||||
$this->site->webserver()->createVHost($this->site);
|
||||
$this->progress(30);
|
||||
app(\App\SSH\PHPMyAdmin\PHPMyAdmin::class)->install($this->site);
|
||||
$this->site->server->ssh($this->site->user)->exec(
|
||||
view('ssh.phpmyadmin.install', [
|
||||
'version' => $this->site->type_data['version'],
|
||||
'path' => $this->site->path,
|
||||
]),
|
||||
'install-phpmyadmin',
|
||||
$this->site->id
|
||||
);
|
||||
$this->progress(65);
|
||||
$this->site->php()?->restart();
|
||||
}
|
||||
|
Reference in New Issue
Block a user