public function __construct($conf = null, $dict = null, $metas = null)
{
if ($conf === null) {
$this->conf = array();
} elseif (is_array($conf)) {
$this->conf = $conf;
} else {
Verify::isTrue(is_file($conf), "{$conf} is not a valid file");
if (strtolower(pathinfo($conf, PATHINFO_EXTENSION)) == 'php') {
$this->conf = (include $conf);
} else {
Verify::isTrue(false !== ($data = file_get_contents($conf)), "{$conf} open failed");
$data = self::clearAnnotation($data);
Verify::isTrue(is_array($this->conf = json_decode($data, true)), "{$conf} json_decode failed with " . json_last_error());
}
$this->conf_file = $conf;
}
if ($dict !== null) {
$this->conf = $this->replaceByDict($this->conf, $dict);
}
$this->metas = $metas;
}