Skip to content

Commit

Permalink
VhostTemplate - Rename template to defaultTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Jul 25, 2017
1 parent 4dc5aa9 commit 0c3bce0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/defaults/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ services:
class: Amp\Httpd\VhostTemplate
calls:
- [setTemplateEngine, ['@template.engine']]
- [setTemplate, ['%apache_tpl%']]
- [setDefaultTemplate, ['%apache_tpl%']]
- [setDir, ['%apache_dir%']]
- [setLogDir, ['%log_dir%']]
- [setPerm, ['@perm']]
Expand All @@ -147,7 +147,7 @@ services:
class: Amp\Httpd\VhostTemplate
calls:
- [setTemplateEngine, ['@template.engine']]
- [setTemplate, ['%apache24_tpl%']]
- [setDefaultTemplate, ['%apache24_tpl%']]
- [setDir, ['%apache_dir%']]
- [setLogDir, ['%log_dir%']]
- [setPerm, ['@perm']]
Expand All @@ -159,7 +159,7 @@ services:
class: Amp\Httpd\VhostTemplate
calls:
- [setTemplateEngine, ['@template.engine']]
- [setTemplate, ['%nginx_tpl%']]
- [setDefaultTemplate, ['%nginx_tpl%']]
- [setDir, ['%nginx_dir%']]
- [setLogDir, ['%log_dir%']]
- [setPerm, ['@perm']]
Expand Down
13 changes: 6 additions & 7 deletions src/Amp/Httpd/VhostTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class VhostTemplate implements HttpdInterface {
/**
* @var string, name of the template file
*/
private $template;
private $defaultTemplate;

/**
* @var EngineInterface
Expand Down Expand Up @@ -72,7 +72,7 @@ public function createVhost($root, $url) {
$parameters['url'] = $url;
$parameters['include_vhost_file'] = '';
$parameters['log_dir'] = $this->getLogDir();
$content = $this->getTemplateEngine()->render($this->getTemplate(), $parameters);
$content = $this->getTemplateEngine()->render($this->getDefaultTemplate(), $parameters);
$this->fs->dumpFile($this->createFilePath($root, $url), $content);

$this->setupLogDir();
Expand Down Expand Up @@ -212,19 +212,18 @@ public function setSharedPorts($httpd_shared_ports) {
$this->httpd_shared_ports = $httpd_shared_ports;
}


/**
* @param string $template
*/
public function setTemplate($template) {
$this->template = $template;
public function setDefaultTemplate($template) {
$this->defaultTemplate = $template;
}

/**
* @return string
*/
public function getTemplate() {
return $this->template;
public function getDefaultTemplate() {
return $this->defaultTemplate;
}

/**
Expand Down

0 comments on commit 0c3bce0

Please sign in to comment.