From 5568bafa53366c751c2abe50c0d5363a5ffb49c6 Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Wed, 15 May 2024 15:09:03 +0300 Subject: [PATCH] Update PHPInstaller.php --- web/app/Filament/Pages/PHPInstaller.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/web/app/Filament/Pages/PHPInstaller.php b/web/app/Filament/Pages/PHPInstaller.php index f1a6442..cb5fdde 100644 --- a/web/app/Filament/Pages/PHPInstaller.php +++ b/web/app/Filament/Pages/PHPInstaller.php @@ -2,6 +2,9 @@ namespace App\Filament\Pages; +use App\Installers\Server\Applications\NodeJsInstaller; +use App\Installers\Server\Applications\PythonInstaller; +use App\Installers\Server\Applications\RubyInstaller; use App\Livewire\Installer; use App\SupportedApplicationTypes; use Filament\Forms\Components\CheckboxList; @@ -53,7 +56,20 @@ class PHPInstaller extends Installer ->columns(5) ->options(SupportedApplicationTypes::getPHPModules()), - ]), + ])->afterValidation(function () { + + $this->install_log = 'Prepare installation...'; + if (is_file(storage_path('server-app-configuration.json'))) { + unlink(storage_path('server-app-configuration.json')); + } + + $phpInstaller = new \App\Installers\Server\Applications\PHPInstaller(); + $phpInstaller->setPHPVersions($this->server_php_versions); + $phpInstaller->setPHPModules($this->server_php_modules); + $phpInstaller->setLogFilePath(storage_path($this->install_log_file_path)); + $phpInstaller->install(); + + }), Wizard\Step::make('Step 2') ->description('Finish installation')