importFile($import_file); } public function importFile(string $file): self { if(!file_exists($file)) throw new Conf\Exception("fileMissing", $file); if(!is_readable($file)) throw new Conf\Exception("fileUnreadable", $file); try { ob_start(); $arr = (@include $file); } catch(\Throwable $e) { $arr = null; } finally { ob_end_clean(); } if(!is_array($arr)) throw new Conf\Exception("fileCorrupt", $file); return $this->import($arr); } public function import(array $arr): self { foreach($arr as $key => $value) { $this->$key = $value; } return $this; } public function export(string $file = ""): string { // TODO } public function __toString(): string { return $this->export(); } }