Skip to content

Commit 1220f8a

Browse files
author
Gareth Midwood
committed
Add custom webroot config variable for PHP container
1 parent 4bb14fb commit 1220f8a

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • src/Environment/Command/Container

src/Environment/Command/Container/Php.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class Php extends Container
1212
[
1313
'active' => true,
1414
'container_name' => 'project_php',
15+
'relative_webroot_dir' => '',
1516
'ports' => [
1617
'80:80'
1718
],
@@ -89,6 +90,18 @@ protected function askQuestions()
8990

9091
$this->_config['environment']['VIRTUAL_HOST'] = '.' . $dockername . '.docker';
9192

93+
94+
$useCustomWebroot = false;
95+
96+
$this->askYesNoQuestion(
97+
'Use custom webroot',
98+
$useCustomWebroot
99+
);
100+
101+
if ($useCustomWebroot) {
102+
$this->_editCustomWebroot();
103+
}
104+
92105
$editEnvironmentVariables = false;
93106

94107
$this->askYesNoQuestion(
@@ -178,4 +191,16 @@ private function _addEnvironmentVariables()
178191
// offer to add another
179192
$this->_addEnvironmentVariables();
180193
}
194+
195+
private function _editCustomWebroot()
196+
{
197+
$this->askQuestion(
198+
'What is the webroot directory, relative to `src` directory (e.g. web)',
199+
$this->_config['relative_webroot_dir'],
200+
''
201+
);
202+
}
203+
204+
205+
181206
}

0 commit comments

Comments
 (0)