I'm trying to come up with the best way to handle configuration in an application. At first i just used SimpleXML and put the code in a singleton.
I've decided to try to create a way to query the configuration with something like $config->getConfig('/module/name');
Do you have to use xpath to do this or is there any other method that is faster/easier to use? I know Magento uses this scheme but with a custom xpath-like syntax.
Feel free to suggest different schemes as long as it is based on XML.
SimpleXML is a nice approach however i feel the need to wrap something around it as the return values are almost always objects where I want a string value.
Could someone explain how to wrap the xpath call to return a string value if the query returns a value, or an object if the query has multiple children?
$xml = $this->xml->xpath($path);
How do you detect if the node returned is a leaf node?