restart php after installing phpmyadmin (#198)

This commit is contained in:
Saeed Vaziry 2024-05-09 12:52:28 +02:00 committed by GitHub
parent 016886f307
commit 765ac21916
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 14 additions and 11 deletions

View File

@ -94,12 +94,6 @@ public function connect(bool $sftp = false): void
public function exec(string $command, string $log = '', ?int $siteId = null, ?bool $stream = false): string public function exec(string $command, string $log = '', ?int $siteId = null, ?bool $stream = false): string
{ {
if (! $this->log && $log) { if (! $this->log && $log) {
$this->log = $this->server->logs()->create([
'site_id' => $siteId,
'name' => $this->server->id.'-'.strtotime('now').'-'.$log.'.log',
'type' => $log,
'disk' => config('core.logs_disk'),
]);
$this->log = ServerLog::make($this->server, $log); $this->log = ServerLog::make($this->server, $log);
if ($siteId) { if ($siteId) {
$this->log->forSite($siteId); $this->log->forSite($siteId);

View File

@ -3,6 +3,7 @@
namespace App\SiteTypes; namespace App\SiteTypes;
use App\Enums\SiteFeature; use App\Enums\SiteFeature;
use App\SSH\Services\Webserver\Webserver;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
class PHPBlank extends PHPSite class PHPBlank extends PHPSite
@ -42,7 +43,9 @@ public function data(array $input): array
public function install(): void public function install(): void
{ {
$this->site->server->webserver()->handler()->createVHost($this->site); /** @var Webserver $webserver */
$webserver = $this->site->server->webserver()->handler();
$webserver->createVHost($this->site);
$this->progress(65); $this->progress(65);
$this->site->php()?->restart(); $this->site->php()?->restart();
} }

View File

@ -41,9 +41,12 @@ public function data(array $input): array
public function install(): void public function install(): void
{ {
$this->site->server->webserver()->handler()->createVHost($this->site); /** @var Webserver $webserver */
$webserver = $this->site->server->webserver()->handler();
$webserver->createVHost($this->site);
$this->progress(30); $this->progress(30);
app(\App\SSH\PHPMyAdmin\PHPMyAdmin::class)->install($this->site); app(\App\SSH\PHPMyAdmin\PHPMyAdmin::class)->install($this->site);
$this->progress(65); $this->progress(65);
$this->site->php()?->restart();
} }
} }

View File

@ -68,7 +68,9 @@ public function data(array $input): array
*/ */
public function install(): void public function install(): void
{ {
$this->site->server->webserver()->handler()->createVHost($this->site); /** @var Webserver $webserver */
$webserver = $this->site->server->webserver()->handler();
$webserver->createVHost($this->site);
$this->progress(15); $this->progress(15);
$this->deployKey(); $this->deployKey();
$this->progress(30); $this->progress(30);

View File

@ -81,7 +81,9 @@ public function data(array $input): array
public function install(): void public function install(): void
{ {
$this->site->server->webserver()->handler()->createVHost($this->site); /** @var Webserver $webserver */
$webserver = $this->site->server->webserver()->handler();
$webserver->createVHost($this->site);
$this->progress(30); $this->progress(30);
/** @var Database $database */ /** @var Database $database */
$database = app(CreateDatabase::class)->create($this->site->server, [ $database = app(CreateDatabase::class)->create($this->site->server, [

View File

@ -5,7 +5,6 @@
<x-select-input id="version" name="version" class="mt-1 w-full"> <x-select-input id="version" name="version" class="mt-1 w-full">
<option value="" selected>{{ __("Select") }}</option> <option value="" selected>{{ __("Select") }}</option>
<option value="5.1.2" @if(old('version') == '5.1.2') selected @endif>PHPMyAdmin 5.1.2</option> <option value="5.1.2" @if(old('version') == '5.1.2') selected @endif>PHPMyAdmin 5.1.2</option>
<option value="4.9.11" @if(old('version') == '4.9.11') selected @endif>PHPMyAdmin 4.9.11</option>
</x-select-input> </x-select-input>
@error("version") @error("version")
<x-input-error class="mt-2" :messages="$message" /> <x-input-error class="mt-2" :messages="$message" />