Skip to content

Commit

Permalink
PHRAS-4045 Log - stdout - fix error on worker passed to igorw\get_in() (
Browse files Browse the repository at this point in the history
#4496)

* fix error on get_in on conf

* fix

* fix

* fix
  • Loading branch information
aynsix authored Apr 29, 2024
1 parent 50ca674 commit 4540b28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/Alchemy/Phrasea/Core/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function getConfig()
return $this->parser->parse($this->loadFile($this->config));
}

if (null !== $this->cache) {
if (null !== $this->cache && is_array($this->cache)) {
return $this->cache;
}

Expand All @@ -151,7 +151,13 @@ public function getConfig()
));
}

return $this->cache = require $this->compiled;
$this->cache = require $this->compiled;

if (is_array($this->cache)) {
return $this->cache;
} else {
throw new RuntimeException('Configuration compiled error');
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function setDefault($name)
*/
public function getConfig()
{
if (empty($this->cache)) {
if (empty($this->cache) || !is_array($this->cache)) {
throw new RuntimeException('Configuration is not set up.');
}

Expand Down

0 comments on commit 4540b28

Please sign in to comment.