mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
31 lines
655 B
PHP
31 lines
655 B
PHP
<?php
|
|
|
|
namespace App\ServiceHandlers;
|
|
|
|
use App\Jobs\PHP\InstallPHPExtension;
|
|
use App\Models\Service;
|
|
use App\SSHCommands\PHP\ChangeDefaultPHPCommand;
|
|
|
|
class PHP
|
|
{
|
|
protected Service $service;
|
|
|
|
public function __construct(Service $service)
|
|
{
|
|
$this->service = $service;
|
|
}
|
|
|
|
public function setDefaultCli(): void
|
|
{
|
|
$this->service->server->ssh()->exec(
|
|
new ChangeDefaultPHPCommand($this->service->version),
|
|
'change-default-php'
|
|
);
|
|
}
|
|
|
|
public function installExtension($name): void
|
|
{
|
|
dispatch(new InstallPHPExtension($this->service, $name))->onConnection('ssh');
|
|
}
|
|
}
|