mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
update
This commit is contained in:
parent
3e3e0633df
commit
b59e42ccdf
2 changed files with 13 additions and 39 deletions
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Actions;
|
||||
|
||||
use App\ShellApi;
|
||||
|
||||
class ApacheWebsiteDelete
|
||||
{
|
||||
public $domain;
|
||||
|
||||
public function setDomain($domain)
|
||||
{
|
||||
$this->domain = $domain;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
if (empty($this->domain)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$apacheConf = '/etc/apache2/sites-available/'.$this->domain.'.conf';
|
||||
shell_exec('rm -rf '.$apacheConf);
|
||||
|
||||
$apacheConfEnabled = '/etc/apache2/sites-enabled/'.$this->domain.'.conf';
|
||||
shell_exec('rm -rf '.$apacheConfEnabled);
|
||||
|
||||
// SSL
|
||||
$apacheSSLConf = '/etc/apache2/sites-available/'.$this->domain.'-ssl.conf';
|
||||
shell_exec('rm -rf '.$apacheSSLConf);
|
||||
|
||||
$apacheSSLConfEnabled = '/etc/apache2/sites-enabled/'.$this->domain.'-ssl.conf';
|
||||
shell_exec('rm -rf '.$apacheSSLConfEnabled);
|
||||
|
||||
}
|
||||
}
|
|
@ -98,9 +98,19 @@ class Domain extends Model
|
|||
|
||||
shell_exec('rm -rf '.$model->domain_public);
|
||||
|
||||
$deleteApacheWebsite = new ApacheWebsiteDelete();
|
||||
$deleteApacheWebsite->setDomain($model->domain);
|
||||
$deleteApacheWebsite->handle();
|
||||
$apacheConf = '/etc/apache2/sites-available/'.$model->domain.'.conf';
|
||||
shell_exec('rm -rf '.$apacheConf);
|
||||
|
||||
$apacheConfEnabled = '/etc/apache2/sites-enabled/'.$model->domain.'.conf';
|
||||
shell_exec('rm -rf '.$apacheConfEnabled);
|
||||
|
||||
// SSL
|
||||
$apacheSSLConf = '/etc/apache2/sites-available/'.$model->domain.'-ssl.conf';
|
||||
shell_exec('rm -rf '.$apacheSSLConf);
|
||||
|
||||
$apacheSSLConfEnabled = '/etc/apache2/sites-enabled/'.$model->domain.'-ssl.conf';
|
||||
shell_exec('rm -rf '.$apacheSSLConfEnabled);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue