|
|
@ -108,6 +108,8 @@ class NginxVhostsCommand extends Command |
|
|
|
'redirect_www' => true |
|
|
|
]; |
|
|
|
|
|
|
|
exec('find /lib/systemd/system/ -name "php[0-9\.]*-fpm.service"', $files); |
|
|
|
|
|
|
|
// create checkbox for ssl
|
|
|
|
$checkboxSSL = new CheckboxItem('ssl', function(CliMenu $menu) use (&$configuration) { |
|
|
|
$configuration['ssl'] = $menu->getSelectedItem()->getChecked(); |
|
|
@ -152,6 +154,18 @@ class NginxVhostsCommand extends Command |
|
|
|
$menu->getSelectedItem()->setText('index: '.$result->fetch()); |
|
|
|
$menu->redraw(); |
|
|
|
}) |
|
|
|
->addLineBreak('-'); |
|
|
|
|
|
|
|
foreach($files as $index => $file) { |
|
|
|
$file = str_replace('/lib/systemd/system/', '', $file); |
|
|
|
$file = str_replace('.service', '', $file); |
|
|
|
|
|
|
|
$builder->addRadioItem($file, function(CliMenu $menu) use (&$configuration) { |
|
|
|
$configuration['php_fpm'] = $menu->getSelectedItem()->getText(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
$builder |
|
|
|
->addLineBreak('-') |
|
|
|
|
|
|
|
// options
|
|
|
@ -169,7 +183,8 @@ class NginxVhostsCommand extends Command |
|
|
|
|
|
|
|
$validator = v::key('domain', v::domain(false)) |
|
|
|
->key('root', v::directory()) |
|
|
|
->key('index', v::file()); |
|
|
|
->key('index', v::file()) |
|
|
|
->key('php_fpm', v::notEmpty()); |
|
|
|
|
|
|
|
try { |
|
|
|
$validator->assert($data); |
|
|
|