config = $config; $this->group = $group; $this->prefix = $prefix; $this->postfix = $postfix; } /** * Return a description of the configuration group (with prefix and postfix). */ public function describe($property) { return $this->prefix . $this->group . $this->postfix . $property; } /** * Get the requested configuration key from the most specific configuration * group that contains it. */ abstract public function get($key); /** * Given a group name, such as "foo.bar.baz", return the next configuration * group in the fallback hierarchy, e.g. "foo.bar". */ protected function moreGeneralGroupName($group) { $result = preg_replace('#\.[^.]*$#', '', $group); if ($result != $group) { return $result; } return false; } }