mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
update
This commit is contained in:
parent
691bcb7c85
commit
0f8b14764b
2 changed files with 13 additions and 9 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Domain;
|
||||
use App\VirtualHosts\ApacheBuild;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class RunDomainRepair extends Command
|
||||
|
@ -26,13 +27,8 @@ class RunDomainRepair extends Command
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
$getAllDomains = Domain::all();
|
||||
if ($getAllDomains->count() > 0) {
|
||||
foreach ($getAllDomains as $domain) {
|
||||
$this->info('Repair domain: ' . $domain->domain);
|
||||
$domain->configureVirtualHost(false);
|
||||
}
|
||||
shell_exec('service apache2 restart');
|
||||
}
|
||||
$apache = new ApacheBuild();
|
||||
$apache->fixPermissions();
|
||||
$apache->build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,14 @@ use App\Models\Domain;
|
|||
|
||||
class ApacheBuild
|
||||
{
|
||||
|
||||
public $fixPermissions = false;
|
||||
|
||||
public function fixPermissions()
|
||||
{
|
||||
$this->fixPermissions = true;
|
||||
}
|
||||
|
||||
public function build()
|
||||
{
|
||||
$virtualHostMerged = '
|
||||
|
@ -77,7 +85,7 @@ IncludeOptional conf-enabled/*.conf
|
|||
$getAllDomains = Domain::all();
|
||||
foreach ($getAllDomains as $domain) {
|
||||
|
||||
$domainVirtualHost = $domain->configureVirtualHost(false);
|
||||
$domainVirtualHost = $domain->configureVirtualHost($this->fixPermissions);
|
||||
if (isset($domainVirtualHost['apacheBaseConfig'])) {
|
||||
$virtualHostMerged .= $domainVirtualHost['apacheBaseConfig'] . "\n\n";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue