mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-06 11:25:33 +01:00
Add Apache support to Drupal
This commit is contained in:
parent
2f6673d941
commit
3065597f64
7 changed files with 34 additions and 4 deletions
|
@ -113,6 +113,14 @@ final class CreateListOfFilesToGenerate
|
|||
path: 'tools/docker/images/php/root/usr/local/etc/php',
|
||||
));
|
||||
|
||||
if (static::isApache(Arr::get($configurationData, 'web.type'))) {
|
||||
$filesToGenerate[] = new TemplateFile(
|
||||
data: 'php/drupal/apache/000-default.conf',
|
||||
name: '000-default.conf',
|
||||
path: 'tools/docker/images/php/root/etc/apache2/sites-available',
|
||||
);
|
||||
}
|
||||
|
||||
if (static::isCaddy(Arr::get($configurationData, 'web.type'))) {
|
||||
$filesToGenerate[] = new TemplateFile(
|
||||
data: 'php/drupal/caddy/Caddyfile',
|
||||
|
@ -170,6 +178,15 @@ final class CreateListOfFilesToGenerate
|
|||
return $next([$configurationData, $configDto, $filesToGenerate]);
|
||||
}
|
||||
|
||||
private static function isApache(?string $webServer): bool
|
||||
{
|
||||
if (is_null($webServer)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $webServer === WebServer::Apache->value;
|
||||
}
|
||||
|
||||
private static function isCaddy(?string $webServer): bool
|
||||
{
|
||||
if (is_null($webServer)) {
|
||||
|
|
|
@ -251,7 +251,7 @@ final class ConfigDto
|
|||
|
||||
#[Assert\Collection([
|
||||
'type' => new Assert\Required([
|
||||
new Assert\Choice(choices: ['nginx', 'caddy']),
|
||||
new Assert\Choice(choices: ['apache', 'caddy', 'nginx']),
|
||||
]),
|
||||
])]
|
||||
public array $web;
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace App\Enum;
|
|||
|
||||
enum WebServer: string
|
||||
{
|
||||
case Apache = 'apache';
|
||||
case Caddy = 'caddy';
|
||||
case Nginx = 'nginx';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue