Implement YAML config loader
This commit is contained in:
parent
14c22e0e6c
commit
6c41f06105
14 changed files with 169 additions and 9 deletions
|
|
@ -70,10 +70,23 @@ class AppConfig
|
|||
return $this->dateTimeFormat;
|
||||
}
|
||||
|
||||
public function getTwigCacheDir(): ?string
|
||||
{
|
||||
if (empty($this->twigCacheDir)) {
|
||||
return null;
|
||||
} elseif (substr($this->twigCacheDir, 0, 1) === '/') {
|
||||
// Absolute path
|
||||
return $this->twigCacheDir;
|
||||
} else {
|
||||
// Relative path
|
||||
return ROOT_DIR . '/' . $this->twigCacheDir;
|
||||
}
|
||||
}
|
||||
|
||||
public function getTwigSettings(): array
|
||||
{
|
||||
return [
|
||||
'cache' => $this->twigCacheDir ?: false,
|
||||
'cache' => $this->getTwigCacheDir() ?: false,
|
||||
'debug' => $this->isDebugMode(),
|
||||
'strict_variables' => $this->isDebugMode(),
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue