Skip to content

Commit 12b0332

Browse files
Merge pull request #15 from ByteInternet/varnish-platform-configuration
Option to use supervisor and set memory for varnish platform conf
2 parents f9828fa + 0811b26 commit 12b0332

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/PlatformConfiguration/VarnishConfiguration.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class VarnishConfiguration implements
2424
private const DEFAULT_BACKEND_PORT = 6082;
2525
private const DEFAULT_CONFIG_FILE = 'etc/varnish.vcl';
2626
private const DEFAULT_VARNISH_VERSION = '4.0';
27+
private const DEFAULT_VARNISH_MEMORY = 1024;
2728

2829
/**
2930
* @var int
@@ -45,6 +46,16 @@ class VarnishConfiguration implements
4546
*/
4647
private $version;
4748

49+
/**
50+
* @var int
51+
*/
52+
private $memory;
53+
54+
/**
55+
* @var bool
56+
*/
57+
private $useSupervisor;
58+
4859
/**
4960
* @var array
5061
*/
@@ -55,19 +66,25 @@ class VarnishConfiguration implements
5566
* @param int $backendPort
5667
* @param string $configFile
5768
* @param string $version
69+
* @param int $memory
70+
* @param bool $useSupervisor
5871
* @param array $arguments
5972
*/
6073
public function __construct(
6174
$frontendPort = self::DEFAULT_FRONTEND_PORT,
6275
$backendPort = self::DEFAULT_BACKEND_PORT,
6376
$configFile = self::DEFAULT_CONFIG_FILE,
6477
$version = self::DEFAULT_VARNISH_VERSION,
78+
$memory = self::DEFAULT_VARNISH_MEMORY,
79+
$useSupervisor = false,
6580
array $arguments = []
6681
) {
6782
$this->frontendPort = $frontendPort;
6883
$this->backendPort = $backendPort;
6984
$this->configFile = $configFile;
7085
$this->version = $version;
86+
$this->memory = $memory;
87+
$this->useSupervisor = $useSupervisor;
7188
$this->arguments = $arguments;
7289

7390
$this->setServerRoles([ServerRole::APPLICATION, ServerRole::LOAD_BALANCER]);
@@ -93,6 +110,16 @@ public function getVersion(): string
93110
return $this->version;
94111
}
95112

113+
public function getMemory(): int
114+
{
115+
return $this->memory;
116+
}
117+
118+
public function useSupervisor(): bool
119+
{
120+
return $this->useSupervisor;
121+
}
122+
96123
/**
97124
* @return array
98125
*/

0 commit comments

Comments
 (0)