PhyrePanel/web/app/Actions/ApacheWebsiteDelete.php
Bozhidar Slaveykov f8ae6c0153 update
2024-04-02 18:51:50 +03:00

33 lines
795 B
PHP

<?php
namespace App\Actions;
use App\ShellApi;
class ApacheWebsiteDelete
{
public $domain;
public function setDomain($domain)
{
$this->domain = $domain;
}
public function handle()
{
$apacheConf = '/etc/apache2/sites-available/'.$this->domain.'.conf';
ShellApi::exec('rm -rf ' . $apacheConf);
$apacheConfEnabled = '/etc/apache2/sites-enabled/'.$this->domain.'.conf';
ShellApi::exec('rm -rf ' . $apacheConfEnabled);
// SSL
$apacheSSLConf = '/etc/apache2/sites-available/'.$this->domain.'-ssl.conf';
ShellApi::exec('rm -rf ' . $apacheSSLConf);
$apacheSSLConfEnabled = '/etc/apache2/sites-enabled/'.$this->domain.'-ssl.conf';
ShellApi::exec('rm -rf ' . $apacheSSLConfEnabled);
}
}