Skip to content

Commit

Permalink
Dev: comment on simplexml fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 21, 2016
1 parent 867f830 commit 5a39a5d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions application/models/TemplateConfiguration.php
Expand Up @@ -126,6 +126,8 @@ public function setTemplateConfiguration($sTemplateName='', $iSurveyId='')

// We load the config file
// $this->config = simplexml_load_file(realpath ($this->xmlFile));
// Simple Xml is buggy on PHP < 5.4. The json_encode/decode workaround seems to be the most used one.
// @see: http://php.net/manual/de/book.simplexml.php#105330 (top comment on PHP doc for simplexml)
$this->config = json_decode( json_encode ( ( array ) simplexml_load_file(realpath ($this->xmlFile)), 1));
// Template configuration.
$this->viewPath = $this->path.DIRECTORY_SEPARATOR.$this->config->engine->pstpldirectory.DIRECTORY_SEPARATOR;
Expand Down

0 comments on commit 5a39a5d

Please sign in to comment.