<?php
namespace Env\Config { class Handler { private $xml; public function get($path) { $stretchs = explode(':', $path); $tmp = $this->xml; foreach($stretchs as $s) { if(isset($tmp[$s])) { $tmp = $tmp[$s]; } else { return ''; } } return $tmp; } public function __construct($xml = false) { if(!$xml) $xml = $this->fallbackConfig(); $this->xml = simplexml_to_array($xml); } private function fallbackConfig() { return simplexml_load_string('<?xml version="1.0" encoding="UTF-8" ?>
<config>
<document>
<version>DOCTYPE_HTML_5</version>
<lang>en</lang>
<xmlns>http://www.w3.org/1999/xhtml</xmlns>
</document>
<site>
<charset>utf-8</charset>
<contentType>text/html</contentType>
<title>Pixelsize Artise</title>
<lang>en</lang>
</site>
<bakers>
<std>
<rewriteCond>#[:]#</rewriteCond>
</std>
<ajax>
<rewriteCond>#[:]#</rewriteCond>
</ajax>
</bakers>
<saveHunterLogs>1</saveHunterLogs>
</config>'); } } } ?>