3 namespace DrupalCodeGenerator\Command\Other;
5 use DrupalCodeGenerator\Command\BaseGenerator;
6 use Symfony\Component\Console\Input\InputInterface;
7 use Symfony\Component\Console\Output\OutputInterface;
8 use Symfony\Component\Console\Question\Question;
11 * Implements other:apache-virtual-host command.
13 class ApacheVirtualHost extends BaseGenerator {
15 protected $name = 'other:apache-virtual-host';
16 protected $description = 'Generates an Apache site configuration file';
17 protected $alias = 'apache-virtual-host';
18 protected $destination = '/etc/apache2/sites-available';
23 protected function interact(InputInterface $input, OutputInterface $output) {
26 'hostname' => new Question('Host name', 'example.com'),
27 'docroot' => new Question('Document root', '/var/www/{hostname}/public'),
30 $this->collectVars($input, $output, $questions);
33 ->path('{hostname}.conf')
34 ->template('other/apache-virtual-host.twig');