Config_Lite::getString PHP Method

getString() public method

returns a stripslashed string
public getString ( string $sec, string $key, mixed $default = null ) : string
$sec string Section
$key string Key
$default mixed default return value
return string
    public function getString($sec, $key, $default = null)
    {
        if (null === $this->sections && null === $default) {
            throw new Config_Lite_Exception_Runtime('configuration seems to be empty, no sections.');
        }
        if (null === $sec && array_key_exists($key, $this->sections)) {
            return stripslashes($this->sections[$key]);
        }
        if (array_key_exists($key, $this->sections[$sec])) {
            return stripslashes($this->sections[$sec][$key]);
        }
        if (null !== $default) {
            return $default;
        }
        throw new Config_Lite_Exception_UnexpectedValue('key not found, no default value given.');
    }