|
@ -91,12 +91,12 @@ class NginxVhostFactory |
|
|
->disableDefaultItems() |
|
|
->disableDefaultItems() |
|
|
|
|
|
|
|
|
// edit configuration
|
|
|
// edit configuration
|
|
|
->addItem('edit', function(CliMenu $menu) use ($vhost) { |
|
|
|
|
|
|
|
|
->addItem('edit', function(CliMenu $menu) use (&$vhost) { |
|
|
system('nano /etc/nginx/sites-available/'.$vhost['file'].' > `tty`'); |
|
|
system('nano /etc/nginx/sites-available/'.$vhost['file'].' > `tty`'); |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// delete configuration
|
|
|
// delete configuration
|
|
|
->addItem('delete', function(CliMenu $menu) use ($vhost) { |
|
|
|
|
|
|
|
|
->addItem('delete', function(CliMenu $menu) use (&$vhost) { |
|
|
|
|
|
|
|
|
if ($vhost['enabled'] === true) { |
|
|
if ($vhost['enabled'] === true) { |
|
|
$menu->flash('Please disable first!')->display(); |
|
|
$menu->flash('Please disable first!')->display(); |
|
@ -166,10 +166,10 @@ class NginxVhostFactory |
|
|
* @param [type] $vhost |
|
|
* @param [type] $vhost |
|
|
* @return [type] |
|
|
* @return [type] |
|
|
*/ |
|
|
*/ |
|
|
private function createVhostCheckbox($vhost) |
|
|
|
|
|
|
|
|
private function createVhostCheckbox(&$vhost) |
|
|
{ |
|
|
{ |
|
|
// create checkbox for enabled / disabled
|
|
|
// create checkbox for enabled / disabled
|
|
|
$checkbox = new CheckboxItem('enabled', function(CliMenu $menu) use ($vhost) { |
|
|
|
|
|
|
|
|
$checkbox = new CheckboxItem('enabled', function(CliMenu $menu) use (&$vhost) { |
|
|
|
|
|
|
|
|
// check status
|
|
|
// check status
|
|
|
if ($menu->getSelectedItem()->getChecked()) { |
|
|
if ($menu->getSelectedItem()->getChecked()) { |
|
|