}
// }}}
- // {{{ get(key)
+ // {{{ get(key, [layer])
/**
* Returns a configuration value, prioritizing layers as per the
*
* @access public
*/
- function get($key)
+ function get($key, $layer = null)
{
- foreach ($this->layers as $layer) {
- if (isset($this->configuration[$layer][$key])) {
- return $this->configuration[$layer][$key];
+ if ($layer === null) {
+ foreach ($this->layers as $layer) {
+ if (isset($this->configuration[$layer][$key])) {
+ return $this->configuration[$layer][$key];
+ }
}
+ } elseif (isset($this->configuration[$layer][$key])) {
+ return $this->configuration[$layer][$key];
}
return null;
}
return false;
}
+ // }}}
+ // {{{ isDefinedLayer(key)
+
+ /**
+ * Tells whether a given config layer exists.
+ *
+ * @param string config layer
+ *
+ * @return bool whether <config layer> exists in this object
+ *
+ * @access public
+ */
+ function isDefinedLayer($layer)
+ {
+ return isset($this->configuration[$layer]);
+ }
+
// }}}
}