Commit 3de10c2a authored by gdd's avatar gdd
Browse files

Added some additional comments around config_decode()

parent 0242e3e8
......@@ -146,6 +146,11 @@ function config_decode($data) {
if (empty($data)) {
return array();
}
// This is the fastest and easiest way to get from a string of XML to a PHP
// array since SimpleXML and json_decode()/encode() are native to PHP. Our
// only other choice would be a custom userspace implementation which would
// be a lot less performant and more complex.
$xml = new SimpleXMLElement($data);
$json = json_encode($xml);
return json_decode($json, TRUE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment