public function persist() { $data = $this->getFullStatus(); $xml = Ezer_Config::createFromArray($data); $path = $this->path; if ($this->debugPath) { $path = str_replace('.xml', '.' . $this->debugIndex++ . '.xml', $this->path); } $xml->saveXml($path); }
/** * @param array $arr * @return Ezer_Config */ public static function createFromArray(array $arr) { $instance = new Ezer_Config(); foreach ($arr as $key => $value) { $instance->keys[] = $key; if (is_array($value)) { $value = Ezer_Config::createFromArray($value); } $instance[$key] = $value; } return $instance; }