refactoring (#116)

- refactoring architecture
- fix incomplete ssh logs
- code editor for scripts in the app
- remove Jobs and SSHCommands
This commit is contained in:
Saeed Vaziry
2024-03-14 20:03:43 +01:00
committed by GitHub
parent cee4a70c3c
commit 428140b931
472 changed files with 24110 additions and 8159 deletions

View File

@ -3,10 +3,7 @@
namespace App\SiteTypes;
use App\Enums\SiteFeature;
use App\Jobs\Site\CreateVHost;
use Illuminate\Support\Facades\Bus;
use Illuminate\Validation\Rule;
use Throwable;
class PHPBlank extends PHPSite
{
@ -20,7 +17,7 @@ public function supportedFeatures(): array
];
}
public function createValidationRules(array $input): array
public function createRules(array $input): array
{
return [
'php_version' => [
@ -45,23 +42,8 @@ public function data(array $input): array
public function install(): void
{
$chain = [
new CreateVHost($this->site),
$this->progress(65),
function () {
$this->site->php()?->restart();
},
];
$chain[] = function () {
$this->site->installationFinished();
};
Bus::chain($chain)
->catch(function (Throwable $e) {
$this->site->installationFailed($e);
})
->onConnection('ssh-long')
->dispatch();
$this->site->server->webserver()->handler()->createVHost($this->site);
$this->progress(65);
$this->site->php()?->restart();
}
}