PhyrePanel/web/app/Actions/ApacheWebsiteDelete.php
Bozhidar Slaveykov 67cd7ec58b update
2024-04-06 16:01:46 +03:00

32 lines
786 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);
}
}