mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 02:11:36 +00:00
31 lines
665 B
PHP
31 lines
665 B
PHP
<?php
|
|
|
|
namespace App\ServiceHandlers;
|
|
|
|
use App\Enums\ServiceStatus;
|
|
use App\Jobs\PHP\InstallPHPExtension;
|
|
use App\Jobs\PHP\SetDefaultCli;
|
|
use App\Models\Service;
|
|
|
|
class PHP
|
|
{
|
|
protected Service $service;
|
|
|
|
public function __construct(Service $service)
|
|
{
|
|
$this->service = $service;
|
|
}
|
|
|
|
public function setDefaultCli(): void
|
|
{
|
|
$this->service->update(['status' => ServiceStatus::RESTARTING]);
|
|
|
|
dispatch(new SetDefaultCli($this->service))->onConnection('ssh');
|
|
}
|
|
|
|
public function installExtension($name): void
|
|
{
|
|
dispatch(new InstallPHPExtension($this->service, $name))->onConnection('ssh-long');
|
|
}
|
|
}
|